@khanacademy/math-input 0.6.8 → 0.7.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 (132) hide show
  1. package/.eslintrc.js +1 -0
  2. package/CHANGELOG.md +6 -0
  3. package/dist/components/common-style.d.ts +21 -0
  4. package/dist/components/common-style.js.flow +27 -0
  5. package/dist/components/input/cursor-contexts.d.ts +19 -0
  6. package/dist/components/input/cursor-contexts.js.flow +32 -0
  7. package/dist/components/input/cursor-handle.d.ts +25 -0
  8. package/dist/components/input/cursor-handle.js.flow +28 -0
  9. package/dist/components/input/math-input.d.ts +128 -0
  10. package/dist/components/input/math-input.js.flow +152 -0
  11. package/dist/components/keypad/button-assets.d.ts +6 -0
  12. package/dist/components/keypad/button-assets.js.flow +12 -0
  13. package/dist/components/keypad/button.d.ts +14 -0
  14. package/dist/components/keypad/button.js.flow +19 -0
  15. package/dist/components/keypad/index.d.ts +15 -0
  16. package/dist/components/keypad/index.js.flow +22 -0
  17. package/dist/components/keypad/keypad-page-items.d.ts +24 -0
  18. package/dist/components/keypad/keypad-page-items.js.flow +30 -0
  19. package/dist/components/keypad/numeric-input-page.d.ts +8 -0
  20. package/dist/components/keypad/numeric-input-page.js.flow +13 -0
  21. package/dist/components/keypad/pre-algebra-page.d.ts +8 -0
  22. package/dist/components/keypad/pre-algebra-page.js.flow +13 -0
  23. package/dist/components/keypad/trigonometry-page.d.ts +8 -0
  24. package/dist/components/keypad/trigonometry-page.js.flow +15 -0
  25. package/dist/components/provided-keypad.d.ts +23 -0
  26. package/dist/components/provided-keypad.js.flow +32 -0
  27. package/dist/components/tabbar/icons.d.ts +7 -0
  28. package/dist/components/tabbar/icons.js.flow +13 -0
  29. package/dist/components/tabbar/item.d.ts +14 -0
  30. package/dist/components/tabbar/item.js.flow +20 -0
  31. package/dist/components/tabbar/tabbar.d.ts +14 -0
  32. package/dist/components/tabbar/tabbar.js.flow +20 -0
  33. package/{src/components/tabbar/types.js → dist/components/tabbar/types.d.ts} +0 -2
  34. package/dist/components/tabbar/types.js.flow +7 -0
  35. package/dist/components/z-indexes.d.ts +7 -0
  36. package/dist/components/z-indexes.js.flow +13 -0
  37. package/dist/consts.d.ts +51 -0
  38. package/dist/consts.js.flow +66 -0
  39. package/dist/data/key-configs.d.ts +7 -0
  40. package/dist/data/key-configs.js.flow +13 -0
  41. package/dist/data/keys.d.ts +57 -0
  42. package/dist/data/keys.js.flow +112 -0
  43. package/dist/es/index.js +487 -985
  44. package/dist/es/index.js.map +1 -1
  45. package/dist/fake-react-native-web/index.d.ts +10 -0
  46. package/dist/fake-react-native-web/index.js.flow +8 -0
  47. package/dist/fake-react-native-web/text.d.ts +12 -0
  48. package/dist/fake-react-native-web/text.js.flow +18 -0
  49. package/dist/fake-react-native-web/view.d.ts +22 -0
  50. package/dist/fake-react-native-web/view.js.flow +28 -0
  51. package/dist/index.d.ts +14 -2
  52. package/dist/index.js +524 -951
  53. package/dist/index.js.flow +20 -2
  54. package/dist/index.js.map +1 -1
  55. package/dist/store/index.d.ts +1 -0
  56. package/dist/store/index.js.flow +7 -0
  57. package/dist/utils.d.ts +1 -0
  58. package/dist/utils.js.flow +7 -0
  59. package/package.json +2 -2
  60. package/src/components/__tests__/gesture-state-machine_test.js +1 -1
  61. package/src/components/__tests__/node-manager_test.js +1 -1
  62. package/src/components/__tests__/two-page-keypad_test.js +1 -1
  63. package/src/components/app.js +2 -2
  64. package/src/components/{common-style.js → common-style.ts} +0 -1
  65. package/src/components/compute-layout-parameters.js +2 -2
  66. package/src/components/corner-decal.js +2 -2
  67. package/src/components/echo-manager.js +5 -5
  68. package/src/components/empty-keypad-button.js +3 -3
  69. package/src/components/expression-keypad.js +10 -10
  70. package/src/components/fraction-keypad.js +9 -9
  71. package/src/components/gesture-manager.js +3 -3
  72. package/src/components/icon.js +6 -6
  73. package/src/components/iconography/down.js +1 -1
  74. package/src/components/iconography/index.js +41 -41
  75. package/src/components/iconography/left.js +1 -1
  76. package/src/components/iconography/right.js +1 -1
  77. package/src/components/iconography/up.js +1 -1
  78. package/src/components/input/__tests__/context-tracking_test.js +3 -3
  79. package/src/components/input/__tests__/mathquill_test.js +2 -2
  80. package/src/components/input/__tests__/test-math-wrapper.jsx +1 -1
  81. package/src/components/input/{cursor-contexts.js → cursor-contexts.ts} +7 -14
  82. package/src/components/input/{cursor-handle.js → cursor-handle.tsx} +19 -20
  83. package/src/components/input/{math-input.js → math-input.tsx} +170 -151
  84. package/src/components/input/math-wrapper.js +5 -5
  85. package/src/components/input/scroll-into-view.js +1 -1
  86. package/src/components/keypad/{button-assets.js → button-assets.tsx} +5 -4
  87. package/src/components/keypad/button.stories.js +1 -1
  88. package/src/components/keypad/{button.js → button.tsx} +9 -9
  89. package/src/components/keypad/{index.js → index.tsx} +16 -15
  90. package/src/components/keypad/{keypad-page-items.js → keypad-page-items.tsx} +24 -39
  91. package/src/components/keypad/{keypad-pages.stories.js → keypad-pages.stories.tsx} +6 -8
  92. package/src/components/keypad/{keypad.stories.js → keypad.stories.tsx} +3 -5
  93. package/src/components/keypad/{numeric-input-page.js → numeric-input-page.tsx} +6 -7
  94. package/src/components/keypad/{pre-algebra-page.js → pre-algebra-page.tsx} +6 -7
  95. package/src/components/keypad/{trigonometry-page.js → trigonometry-page.tsx} +6 -7
  96. package/src/components/keypad-button.js +7 -11
  97. package/src/components/keypad-container.js +10 -10
  98. package/src/components/keypad.js +5 -5
  99. package/src/components/many-keypad-button.js +6 -6
  100. package/src/components/math-icon.js +3 -3
  101. package/src/components/multi-symbol-grid.js +6 -6
  102. package/src/components/multi-symbol-popover.js +5 -5
  103. package/src/components/navigation-pad.js +6 -6
  104. package/src/components/popover-manager.js +3 -3
  105. package/src/components/prop-types.js +3 -3
  106. package/src/components/{provided-keypad.js → provided-keypad.tsx} +16 -14
  107. package/src/components/styles.js +1 -1
  108. package/src/components/svg-icon.js +1 -1
  109. package/src/components/tabbar/__tests__/tabbar_test.js +1 -1
  110. package/src/components/tabbar/{icons.js → icons.tsx} +7 -12
  111. package/src/components/tabbar/{item.js → item.tsx} +6 -8
  112. package/src/components/tabbar/tabbar.stories.js +2 -2
  113. package/src/components/tabbar/{tabbar.js → tabbar.tsx} +6 -8
  114. package/src/components/tabbar/types.ts +1 -0
  115. package/src/components/text-icon.js +3 -3
  116. package/src/components/touchable-keypad-button.js +5 -5
  117. package/src/components/two-page-keypad.js +5 -5
  118. package/src/components/{z-indexes.js → z-indexes.ts} +0 -1
  119. package/src/{consts.js → consts.ts} +22 -27
  120. package/src/data/{key-configs.js → key-configs.ts} +7 -8
  121. package/src/data/{keys.js → keys.ts} +7 -13
  122. package/src/demo.js +1 -1
  123. package/src/fake-react-native-web/{index.js → index.ts} +2 -3
  124. package/src/fake-react-native-web/{text.js → text.tsx} +7 -9
  125. package/src/fake-react-native-web/{view.js → view.tsx} +15 -17
  126. package/src/{index.js → index.ts} +9 -10
  127. package/src/native-app.js +3 -3
  128. package/src/store/{index.js → index.ts} +63 -34
  129. package/src/{utils.js → utils.ts} +1 -2
  130. package/tsconfig.json +9 -0
  131. package/tsconfig.tsbuildinfo +1 -0
  132. /package/dist/{strings.js → strings} +0 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file exports components View and Text which wrap <div> and <span>.
3
+ * We do this so that someday in the future we can use these components with
4
+ * React Native.
5
+ *
6
+ * Inspired by https://github.com/necolas/react-native-web. We use aphrodite
7
+ * StyleSheets instead.
8
+ */
9
+ export { default as Text } from "./text";
10
+ export { default as View } from "./view";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ declare export { default as Text } from "./text";
8
+ declare export { default as View } from "./view";
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import type { CSSProperties } from "aphrodite";
3
+ type Props = {
4
+ children: React.ReactNode;
5
+ dynamicStyle?: CSSProperties;
6
+ numberOfLines?: number;
7
+ style?: CSSProperties;
8
+ };
9
+ declare class Text extends React.Component<Props> {
10
+ render(): React.ReactNode;
11
+ }
12
+ export default Text;
@@ -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 type { CSSProperties } from "aphrodite";
9
+ declare type Props = {|
10
+ children: React.Node,
11
+ dynamicStyle?: CSSProperties,
12
+ numberOfLines?: number,
13
+ style?: CSSProperties,
14
+ |};
15
+ declare class Text extends React.Component<Props> {
16
+ render(): React.Node;
17
+ }
18
+ declare export default typeof Text;
@@ -0,0 +1,22 @@
1
+ /// <reference path="../../types/aphrodite.d.ts" />
2
+ import * as React from "react";
3
+ import type { CSSProperties } from "aphrodite";
4
+ type Props = {
5
+ ariaLabel?: string;
6
+ children: React.ReactNode;
7
+ dynamicStyle?: CSSProperties;
8
+ extraClassName?: string;
9
+ numberOfLines?: number;
10
+ onClick?: (arg1: React.SyntheticEvent<HTMLDivElement>) => void;
11
+ onTouchCancel?: (arg1: React.TouchEvent<HTMLDivElement>) => void;
12
+ onTouchEnd?: (arg1: React.TouchEvent<HTMLDivElement>) => void;
13
+ onTouchMove?: (arg1: React.TouchEvent<HTMLDivElement>) => void;
14
+ onTouchStart?: (arg1: React.TouchEvent<HTMLDivElement>) => void;
15
+ role?: string;
16
+ style?: CSSProperties;
17
+ };
18
+ declare class View extends React.Component<Props> {
19
+ static styles: import("aphrodite").StyleDeclaration;
20
+ render(): React.ReactNode;
21
+ }
22
+ export default View;
@@ -0,0 +1,28 @@
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$aphrodite from "aphrodite";
8
+ import * as React from "react";
9
+ import type { CSSProperties } from "aphrodite";
10
+ declare type Props = {|
11
+ ariaLabel?: string,
12
+ children: React.Node,
13
+ dynamicStyle?: CSSProperties,
14
+ extraClassName?: string,
15
+ numberOfLines?: number,
16
+ onClick?: (arg1: SyntheticEvent<HTMLDivElement>) => void,
17
+ onTouchCancel?: (arg1: SyntheticTouchEvent<HTMLDivElement>) => void,
18
+ onTouchEnd?: (arg1: SyntheticTouchEvent<HTMLDivElement>) => void,
19
+ onTouchMove?: (arg1: SyntheticTouchEvent<HTMLDivElement>) => void,
20
+ onTouchStart?: (arg1: SyntheticTouchEvent<HTMLDivElement>) => void,
21
+ role?: string,
22
+ style?: CSSProperties,
23
+ |};
24
+ declare class View extends React.Component<Props> {
25
+ static styles: $Flowgen$Import$aphrodite.StyleDeclaration;
26
+ render(): React.Node;
27
+ }
28
+ declare export default typeof View;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,14 @@
1
- // @flow
2
- export * from "../src/index.js";
1
+ /**
2
+ * A single entry-point for all of the external-facing functionality.
3
+ */
4
+ import "../less/main.less";
5
+ export { default as KeypadInput } from "./components/input/math-input";
6
+ export { keypadConfigurationPropType, keypadElementPropType, } from "./components/prop-types";
7
+ export { default as Keypad } from "./components/provided-keypad";
8
+ export { KeypadTypes } from "./consts";
9
+ export { default as KeyConfigs } from "./data/key-configs";
10
+ import * as CursorContexts from "./components/input/cursor-contexts";
11
+ export { CursorContexts };
12
+ export type { KeypadType, KeyType } from "./consts";
13
+ export type { Key } from "./data/keys";
14
+ export type { CursorContext } from "./components/input/cursor-contexts";