@khanacademy/math-input 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/dist/components/input/__tests__/test-math-wrapper.d.ts +1 -1
- package/dist/components/input/__tests__/test-math-wrapper.js.flow +1 -1
- package/dist/components/input/key-handlers/handle-arrow.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-arrow.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-backspace.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-backspace.js.flow +14 -0
- package/dist/components/input/key-handlers/handle-exponent.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-exponent.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-jump-out.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-jump-out.js.flow +14 -0
- package/dist/components/input/math-input.d.ts +1 -1
- package/dist/components/input/math-input.js.flow +1 -1
- package/dist/components/input/math-wrapper.d.ts +7 -78
- package/dist/components/input/math-wrapper.js.flow +16 -78
- package/dist/components/input/mathquill-helpers.d.ts +46 -0
- package/dist/components/input/mathquill-helpers.js.flow +56 -0
- package/dist/components/input/mathquill-instance.d.ts +3 -0
- package/dist/components/input/mathquill-instance.js.flow +9 -0
- package/dist/components/input/mathquill-types.d.ts +25 -0
- package/dist/components/input/mathquill-types.js.flow +34 -0
- package/dist/components/key-translator.d.ts +4 -0
- package/dist/components/key-translator.js.flow +10 -0
- package/dist/components/keypad/button-assets.d.ts +2 -2
- package/dist/components/keypad/button-assets.js.flow +2 -2
- package/dist/components/keypad/button.d.ts +1 -2
- package/dist/components/keypad/button.js.flow +1 -1
- package/dist/components/keypad/{pre-algebra-page.d.ts → geometry-page/index.d.ts} +1 -1
- package/dist/components/keypad/{pre-algebra-page.js.flow → geometry-page/index.js.flow} +1 -1
- package/dist/components/keypad/index.d.ts +5 -4
- package/dist/components/keypad/index.js.flow +9 -4
- package/dist/components/keypad/keypad-page-items.d.ts +9 -3
- package/dist/components/keypad/keypad-page-items.js.flow +9 -3
- package/dist/components/keypad/{numeric-input-page.d.ts → numbers-page/index.d.ts} +3 -2
- package/dist/components/keypad/numbers-page/index.js.flow +17 -0
- package/dist/components/keypad/numbers-page/types.d.ts +4 -0
- package/dist/components/keypad/numbers-page/types.js.flow +10 -0
- package/dist/components/keypad/operators-page/advanced-relations-buttons.d.ts +7 -0
- package/dist/components/keypad/{numeric-input-page.js.flow → operators-page/advanced-relations-buttons.js.flow} +3 -4
- package/dist/components/keypad/operators-page/basic-relations-buttons.d.ts +7 -0
- package/dist/components/keypad/{trigonometry-page.js.flow → operators-page/basic-relations-buttons.js.flow} +3 -6
- package/dist/components/keypad/operators-page/index.d.ts +9 -0
- package/dist/components/keypad/operators-page/index.js.flow +17 -0
- package/dist/components/keypad/operators-page/logarithms-buttons.d.ts +7 -0
- package/dist/components/keypad/operators-page/logarithms-buttons.js.flow +12 -0
- package/dist/components/keypad/operators-page/pre-algebra-buttons.d.ts +7 -0
- package/dist/components/keypad/operators-page/pre-algebra-buttons.js.flow +12 -0
- package/dist/components/keypad/operators-page/types.d.ts +6 -0
- package/dist/components/keypad/operators-page/types.js.flow +12 -0
- package/dist/components/{compute-layout-parameters.d.ts → keypad-legacy/compute-layout-parameters.d.ts} +1 -1
- package/dist/components/{compute-layout-parameters.js.flow → keypad-legacy/compute-layout-parameters.js.flow} +1 -1
- package/dist/components/{echo-manager.d.ts → keypad-legacy/echo-manager.d.ts} +2 -11
- package/dist/components/{echo-manager.js.flow → keypad-legacy/echo-manager.js.flow} +2 -11
- package/dist/components/{expression-keypad.d.ts → keypad-legacy/expression-keypad.d.ts} +3 -4
- package/dist/components/{expression-keypad.js.flow → keypad-legacy/expression-keypad.js.flow} +3 -4
- package/dist/components/{fraction-keypad.d.ts → keypad-legacy/fraction-keypad.d.ts} +2 -2
- package/dist/components/{fraction-keypad.js.flow → keypad-legacy/fraction-keypad.js.flow} +2 -2
- package/dist/components/{gesture-manager.d.ts → keypad-legacy/gesture-manager.d.ts} +22 -10
- package/dist/components/{gesture-manager.js.flow → keypad-legacy/gesture-manager.js.flow} +28 -13
- package/dist/components/{gesture-state-machine.d.ts → keypad-legacy/gesture-state-machine.d.ts} +9 -9
- package/dist/components/{gesture-state-machine.js.flow → keypad-legacy/gesture-state-machine.js.flow} +10 -10
- package/dist/components/{icon.d.ts → keypad-legacy/icon.d.ts} +1 -1
- package/dist/components/{icon.js.flow → keypad-legacy/icon.js.flow} +1 -1
- package/dist/components/{keypad-button.d.ts → keypad-legacy/keypad-button.d.ts} +6 -6
- package/dist/components/{keypad-button.js.flow → keypad-legacy/keypad-button.js.flow} +7 -7
- package/dist/components/{keypad-container.d.ts → keypad-legacy/keypad-container.d.ts} +2 -2
- package/dist/components/{keypad-container.js.flow → keypad-legacy/keypad-container.js.flow} +3 -3
- package/dist/components/{keypad.d.ts → keypad-legacy/keypad.d.ts} +3 -3
- package/dist/components/{keypad.js.flow → keypad-legacy/keypad.js.flow} +3 -3
- package/dist/components/{multi-symbol-grid.d.ts → keypad-legacy/multi-symbol-grid.d.ts} +1 -1
- package/dist/components/{multi-symbol-grid.js.flow → keypad-legacy/multi-symbol-grid.js.flow} +1 -1
- package/dist/components/{multi-symbol-popover.d.ts → keypad-legacy/multi-symbol-popover.d.ts} +1 -1
- package/dist/components/{multi-symbol-popover.js.flow → keypad-legacy/multi-symbol-popover.js.flow} +1 -1
- package/dist/components/{node-manager.d.ts → keypad-legacy/node-manager.d.ts} +3 -4
- package/dist/components/{node-manager.js.flow → keypad-legacy/node-manager.js.flow} +3 -5
- package/dist/components/{popover-manager.d.ts → keypad-legacy/popover-manager.d.ts} +1 -1
- package/dist/components/{popover-manager.js.flow → keypad-legacy/popover-manager.js.flow} +1 -1
- package/dist/components/{popover-state-machine.d.ts → keypad-legacy/popover-state-machine.d.ts} +1 -1
- package/dist/components/{popover-state-machine.js.flow → keypad-legacy/popover-state-machine.js.flow} +1 -1
- package/dist/components/{provided-keypad.d.ts → keypad-legacy/provided-keypad.d.ts} +1 -1
- package/dist/components/{provided-keypad.js.flow → keypad-legacy/provided-keypad.js.flow} +1 -1
- package/dist/{store → components/keypad-legacy/store}/actions.d.ts +6 -17
- package/dist/{store → components/keypad-legacy/store}/actions.js.flow +7 -22
- package/dist/{store → components/keypad-legacy/store}/index.d.ts +0 -1
- package/dist/{store → components/keypad-legacy/store}/index.js.flow +0 -1
- package/dist/components/keypad-legacy/store/shared.d.ts +7 -0
- package/dist/components/keypad-legacy/store/shared.js.flow +14 -0
- package/dist/{store → components/keypad-legacy/store}/types.d.ts +5 -15
- package/dist/{store → components/keypad-legacy/store}/types.js.flow +5 -15
- package/dist/components/keypad-legacy/touchable-keypad-button.d.ts +37 -0
- package/dist/components/keypad-legacy/touchable-keypad-button.js.flow +59 -0
- package/dist/components/{two-page-keypad.d.ts → keypad-legacy/two-page-keypad.d.ts} +0 -1
- package/dist/components/{two-page-keypad.js.flow → keypad-legacy/two-page-keypad.js.flow} +0 -1
- package/dist/data/key-configs.d.ts +4 -5
- package/dist/data/key-configs.js.flow +3 -6
- package/dist/data/keys.d.ts +2 -56
- package/dist/data/keys.js.flow +116 -57
- package/dist/enums.d.ts +2 -9
- package/dist/enums.js.flow +2 -11
- package/dist/es/index.js +6393 -5116
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +6868 -5330
- package/dist/index.js.flow +6 -3
- package/dist/index.js.map +1 -1
- package/dist/strings.js +26 -10
- package/dist/types.d.ts +19 -17
- package/dist/types.js.flow +28 -23
- package/package.json +1 -1
- package/src/components/input/__tests__/context-tracking.test.ts +43 -44
- package/src/components/input/__tests__/mathquill.test.ts +133 -135
- package/src/components/input/key-handlers/handle-arrow.ts +70 -0
- package/src/components/input/key-handlers/handle-backspace.ts +275 -0
- package/src/components/input/key-handlers/handle-exponent.ts +52 -0
- package/src/components/input/key-handlers/handle-jump-out.ts +103 -0
- package/src/components/input/math-input.tsx +12 -13
- package/src/components/input/math-wrapper.ts +88 -837
- package/src/components/input/mathquill-helpers.ts +268 -0
- package/src/components/input/mathquill-instance.ts +5 -0
- package/src/components/input/mathquill-types.ts +55 -0
- package/src/components/key-translator.ts +209 -0
- package/src/components/keypad/button-assets.tsx +452 -116
- package/src/components/keypad/button.stories.tsx +61 -13
- package/src/components/keypad/button.tsx +1 -1
- package/src/components/keypad/{trigonometry-page.tsx → geometry-page/index.tsx} +4 -5
- package/src/components/keypad/index.tsx +19 -14
- package/src/components/keypad/keypad-mathquill.stories.tsx +69 -0
- package/src/components/keypad/keypad-page-items.tsx +36 -22
- package/src/components/keypad/keypad-pages.stories.tsx +5 -5
- package/src/components/keypad/keypad.stories.tsx +75 -17
- package/src/components/keypad/{numeric-input-page.tsx → numbers-page/index.tsx} +47 -11
- package/src/components/keypad/numbers-page/types.ts +4 -0
- package/src/components/keypad/operators-page/advanced-relations-buttons.tsx +32 -0
- package/src/components/keypad/operators-page/basic-relations-buttons.tsx +32 -0
- package/src/components/keypad/{pre-algebra-page.tsx → operators-page/index.tsx} +26 -30
- package/src/components/keypad/operators-page/logarithms-buttons.tsx +32 -0
- package/src/components/keypad/operators-page/pre-algebra-buttons.tsx +36 -0
- package/src/components/keypad/operators-page/types.ts +6 -0
- package/src/components/{__tests__ → keypad-legacy/__tests__}/two-page-keypad.test.tsx +0 -2
- package/src/components/{compute-layout-parameters.ts → keypad-legacy/compute-layout-parameters.ts} +2 -3
- package/src/components/{corner-decal.tsx → keypad-legacy/corner-decal.tsx} +2 -3
- package/src/components/{echo-manager.tsx → keypad-legacy/echo-manager.tsx} +8 -21
- package/src/components/{empty-keypad-button.tsx → keypad-legacy/empty-keypad-button.tsx} +8 -6
- package/src/components/{expression-keypad.tsx → keypad-legacy/expression-keypad.tsx} +8 -17
- package/src/components/{fraction-keypad.tsx → keypad-legacy/fraction-keypad.tsx} +6 -6
- package/src/components/{gesture-manager.ts → keypad-legacy/gesture-manager.ts} +34 -11
- package/src/components/{gesture-state-machine.ts → keypad-legacy/gesture-state-machine.ts} +14 -14
- package/src/components/{icon.tsx → keypad-legacy/icon.tsx} +3 -3
- package/src/components/{keypad-button.tsx → keypad-legacy/keypad-button.tsx} +26 -26
- package/src/components/{keypad-container.tsx → keypad-legacy/keypad-container.tsx} +6 -6
- package/src/components/{keypad.tsx → keypad-legacy/keypad.tsx} +5 -5
- package/src/components/{many-keypad-button.tsx → keypad-legacy/many-keypad-button.tsx} +13 -6
- package/src/components/{math-icon.tsx → keypad-legacy/math-icon.tsx} +2 -2
- package/src/components/{multi-symbol-grid.tsx → keypad-legacy/multi-symbol-grid.tsx} +4 -4
- package/src/components/{multi-symbol-popover.tsx → keypad-legacy/multi-symbol-popover.tsx} +3 -4
- package/src/components/{navigation-pad.tsx → keypad-legacy/navigation-pad.tsx} +5 -5
- package/src/components/{node-manager.ts → keypad-legacy/node-manager.ts} +2 -10
- package/src/components/{popover-manager.tsx → keypad-legacy/popover-manager.tsx} +2 -2
- package/src/components/{popover-state-machine.ts → keypad-legacy/popover-state-machine.ts} +1 -1
- package/src/components/{provided-keypad.tsx → keypad-legacy/provided-keypad.tsx} +4 -5
- package/src/{store → components/keypad-legacy/store}/actions.ts +7 -36
- package/src/{store → components/keypad-legacy/store}/echo-reducer.ts +3 -7
- package/src/{store → components/keypad-legacy/store}/index.ts +7 -20
- package/src/{store → components/keypad-legacy/store}/input-reducer.ts +4 -5
- package/src/{store → components/keypad-legacy/store}/keypad-reducer.ts +3 -4
- package/src/{store → components/keypad-legacy/store}/layout-reducer.ts +3 -3
- package/src/{store → components/keypad-legacy/store}/shared.ts +3 -3
- package/src/{store → components/keypad-legacy/store}/types.ts +15 -19
- package/src/components/{styles.ts → keypad-legacy/styles.ts} +1 -1
- package/src/components/{text-icon.tsx → keypad-legacy/text-icon.tsx} +2 -2
- package/src/components/{touchable-keypad-button.tsx → keypad-legacy/touchable-keypad-button.tsx} +35 -21
- package/src/components/{two-page-keypad.tsx → keypad-legacy/two-page-keypad.tsx} +5 -6
- package/src/components/tabbar/icons.tsx +0 -2
- package/src/data/key-configs.ts +751 -309
- package/src/data/keys.ts +118 -70
- package/src/enums.ts +10 -9
- package/src/index.ts +6 -3
- package/src/math-input.stories.tsx +3 -3
- package/src/types.ts +21 -16
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/keypad/trigonometry-page.d.ts +0 -8
- package/dist/components/touchable-keypad-button.d.ts +0 -30
- package/dist/components/touchable-keypad-button.js.flow +0 -35
- package/dist/components/velocity-tracker.d.ts +0 -48
- package/dist/components/velocity-tracker.js.flow +0 -54
- package/dist/store/pager-reducer.d.ts +0 -4
- package/dist/store/pager-reducer.js.flow +0 -13
- package/dist/store/shared.d.ts +0 -7
- package/dist/store/shared.js.flow +0 -14
- package/src/components/velocity-tracker.ts +0 -86
- package/src/store/pager-reducer.ts +0 -125
- /package/dist/components/{corner-decal.d.ts → keypad-legacy/corner-decal.d.ts} +0 -0
- /package/dist/components/{corner-decal.js.flow → keypad-legacy/corner-decal.js.flow} +0 -0
- /package/dist/components/{empty-keypad-button.d.ts → keypad-legacy/empty-keypad-button.d.ts} +0 -0
- /package/dist/components/{empty-keypad-button.js.flow → keypad-legacy/empty-keypad-button.js.flow} +0 -0
- /package/dist/components/{many-keypad-button.d.ts → keypad-legacy/many-keypad-button.d.ts} +0 -0
- /package/dist/components/{many-keypad-button.js.flow → keypad-legacy/many-keypad-button.js.flow} +0 -0
- /package/dist/components/{math-icon.d.ts → keypad-legacy/math-icon.d.ts} +0 -0
- /package/dist/components/{math-icon.js.flow → keypad-legacy/math-icon.js.flow} +0 -0
- /package/dist/components/{navigation-pad.d.ts → keypad-legacy/navigation-pad.d.ts} +0 -0
- /package/dist/components/{navigation-pad.js.flow → keypad-legacy/navigation-pad.js.flow} +0 -0
- /package/dist/{store → components/keypad-legacy/store}/echo-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/echo-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/input-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/input-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/keypad-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/keypad-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/layout-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/layout-reducer.js.flow +0 -0
- /package/dist/components/{styles.d.ts → keypad-legacy/styles.d.ts} +0 -0
- /package/dist/components/{styles.js.flow → keypad-legacy/styles.js.flow} +0 -0
- /package/dist/components/{svg-icon.d.ts → keypad-legacy/svg-icon.d.ts} +0 -0
- /package/dist/components/{svg-icon.js.flow → keypad-legacy/svg-icon.js.flow} +0 -0
- /package/dist/components/{text-icon.d.ts → keypad-legacy/text-icon.d.ts} +0 -0
- /package/dist/components/{text-icon.js.flow → keypad-legacy/text-icon.js.flow} +0 -0
- /package/dist/components/{z-indexes.d.ts → keypad-legacy/z-indexes.d.ts} +0 -0
- /package/dist/components/{z-indexes.js.flow → keypad-legacy/z-indexes.js.flow} +0 -0
- /package/src/components/{__tests__ → keypad-legacy/__tests__}/gesture-state-machine.test.ts +0 -0
- /package/src/components/{__tests__ → keypad-legacy/__tests__}/node-manager.test.ts +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/arrow.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/backspace.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cdot.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cos.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cube-root.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/dismiss.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/divide.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/down.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/equal.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp-2.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp-3.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/frac.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/geq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/gt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/index.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-into-numerator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-base.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-denominator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-exponent.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-numerator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-parentheses.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/left-paren.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/left.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/leq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/ln.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/log-n.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/log.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/lt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/minus.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/neq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/parens.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/percent.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/period.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/plus.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/radical.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/right-paren.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/right.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/sin.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/sqrt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/tan.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/times.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/up.js +0 -0
- /package/src/components/{svg-icon.tsx → keypad-legacy/svg-icon.tsx} +0 -0
- /package/src/components/{z-indexes.ts → keypad-legacy/z-indexes.ts} +0 -0
package/dist/strings.js
CHANGED
|
@@ -5,43 +5,51 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
module.exports = [
|
|
8
|
+
// I18N: A label for a button that will allow the user to input a
|
|
8
9
|
i18n._("Cosine", {}),
|
|
9
10
|
// I18N: A label for a button that will cube (take to the third power)
|
|
10
11
|
i18n._("Cube", {}),
|
|
12
|
+
// I18N: A label for a button that will allow the user to input a
|
|
11
13
|
i18n._("Cube root", {}),
|
|
12
|
-
// I18N: A label for a button that will allow the user to input a
|
|
14
|
+
// I18N: A label for a button that will allow the user to input a
|
|
13
15
|
i18n._("Custom exponent", {}),
|
|
14
|
-
// I18N: A label for a decimal
|
|
16
|
+
// I18N: A label for a 'decimal' sign (represented as '.' or ',').
|
|
15
17
|
i18n._("Decimal", {}),
|
|
16
|
-
// I18N: A label for a button that will delete some input.
|
|
17
18
|
i18n._("Delete", {}),
|
|
18
19
|
// I18N: A label for a button that will dismiss/hide a keypad.
|
|
19
20
|
i18n._("Dismiss", {}),
|
|
20
|
-
// I18N: A label for a
|
|
21
|
+
// I18N: A label for a 'divide' sign.
|
|
21
22
|
i18n._("Divide", {}),
|
|
22
23
|
i18n._("Down arrow", {}),
|
|
24
|
+
// I18N: A label for an 'equals' sign (represented as '=').
|
|
23
25
|
i18n._("Equals sign", {}),
|
|
24
26
|
// I18N: A label for a button that creates a new fraction next to the
|
|
25
27
|
// I18N: A label for a button that creates a new fraction next to the
|
|
26
28
|
i18n._("Fraction, excluding the current expression", {}),
|
|
27
29
|
// I18N: A label for a button that creates a new fraction and puts the
|
|
28
30
|
i18n._("Fraction, with current expression in numerator", {}),
|
|
31
|
+
// I18N: A label for a 'greater than or equal to' sign (represented as '≥').
|
|
29
32
|
i18n._("Greater than or equal to sign", {}),
|
|
30
33
|
// I18N: A label for a 'greater than' sign (represented as '>').
|
|
31
34
|
i18n._("Greater than sign", {}),
|
|
32
35
|
i18n._("Left arrow", {}),
|
|
36
|
+
// I18N: A label for a button that will allow the user to input a
|
|
33
37
|
i18n._("Left parenthesis", {}),
|
|
38
|
+
// I18N: A label for a 'less than or equal to' sign (represented as '≤').
|
|
34
39
|
i18n._("Less than or equal to sign", {}),
|
|
35
40
|
// I18N: A label for a 'less than' sign (represented as '<').
|
|
36
41
|
i18n._("Less than sign", {}),
|
|
42
|
+
// I18N: A label for a button that will allow the user to input a
|
|
37
43
|
i18n._("Logarithm with base 10", {}),
|
|
44
|
+
// I18N: A label for a button that will allow the user to input a
|
|
38
45
|
i18n._("Logarithm with custom base", {}),
|
|
39
46
|
i18n._("Math input box", {}),
|
|
40
|
-
// I18N: A label for a minus sign.
|
|
47
|
+
// I18N: A label for a 'minus' sign.
|
|
41
48
|
i18n._("Minus", {}),
|
|
42
|
-
// I18N: A label for a
|
|
43
|
-
// I18N: A label for a multiplication sign (represented as
|
|
49
|
+
// I18N: A label for a 'multiply' sign.
|
|
50
|
+
// I18N: A label for a 'centered dot' multiplication sign (represented as '⋅').
|
|
44
51
|
i18n._("Multiply", {}),
|
|
52
|
+
// I18N: A label for a button that will allow the user to input a
|
|
45
53
|
i18n._("Natural logarithm", {}),
|
|
46
54
|
i18n._("Navigate right into the numerator of a fraction", {}),
|
|
47
55
|
i18n._("Navigate right out of a base", {}),
|
|
@@ -49,23 +57,31 @@ module.exports = [
|
|
|
49
57
|
i18n._("Navigate right out of an exponent", {}),
|
|
50
58
|
i18n._("Navigate right out of the denominator of a fraction", {}),
|
|
51
59
|
i18n._("Navigate right out of the numerator and into the denominator", {}),
|
|
52
|
-
// I18N: A label for a
|
|
60
|
+
// I18N: A label for a 'negative' sign.
|
|
53
61
|
i18n._("Negative", {}),
|
|
62
|
+
// I18N: A label for a 'not-equals' sign (represented as '≠').
|
|
54
63
|
i18n._("Not-equals sign", {}),
|
|
55
|
-
// I18N: A label for a percent sign.
|
|
64
|
+
// I18N: A label for a 'percent' sign (represented as '%').
|
|
56
65
|
i18n._("Percent", {}),
|
|
66
|
+
// I18N: A label for a button that will allow the user to input the
|
|
57
67
|
i18n._("Pi", {}),
|
|
58
|
-
// I18N: A label for a plus sign.
|
|
68
|
+
// I18N: A label for a 'plus' sign.
|
|
59
69
|
i18n._("Plus", {}),
|
|
70
|
+
// I18N: A label for a button that will allow the user to input a
|
|
60
71
|
i18n._("Radical with custom root", {}),
|
|
61
72
|
i18n._("Right arrow", {}),
|
|
73
|
+
// I18N: A label for a button that will allow the user to input a
|
|
62
74
|
i18n._("Right parenthesis", {}),
|
|
75
|
+
// I18N: A label for a button that will allow the user to input a
|
|
63
76
|
i18n._("Sine", {}),
|
|
64
77
|
// I18N: A label for a button that will square (take to the second
|
|
65
78
|
i18n._("Square", {}),
|
|
79
|
+
// I18N: A label for a button that will allow the user to input a
|
|
66
80
|
i18n._("Square root", {}),
|
|
81
|
+
// I18N: A label for a button that will allow the user to input a
|
|
67
82
|
i18n._("Tangent", {}),
|
|
68
83
|
i18n._("Tap with one or two fingers to open keyboard", {}),
|
|
84
|
+
// I18N: A label for a button that will allow the user to input the
|
|
69
85
|
i18n._("Theta", {}),
|
|
70
86
|
i18n._("Up arrow", {}),
|
|
71
87
|
];
|
package/dist/types.d.ts
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Key from "./data/keys";
|
|
2
2
|
import { BorderDirection, EchoAnimationType, IconType, KeyType, KeypadType } from "./enums";
|
|
3
3
|
import type { CursorContext } from "./components/input/cursor-contexts";
|
|
4
4
|
export type Border = Partial<ReadonlyArray<BorderDirection>>;
|
|
5
|
-
export
|
|
5
|
+
export interface Bound {
|
|
6
6
|
top: number;
|
|
7
7
|
right: number;
|
|
8
8
|
bottom: number;
|
|
9
9
|
left: number;
|
|
10
10
|
height: number;
|
|
11
11
|
width: number;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
export type Popover = {
|
|
14
|
-
parentId:
|
|
14
|
+
parentId: Key;
|
|
15
15
|
bounds: Partial<Bound>;
|
|
16
|
-
childKeyIds: Array<
|
|
16
|
+
childKeyIds: Array<Key>;
|
|
17
17
|
};
|
|
18
18
|
export type Echo = {
|
|
19
19
|
animationId: string;
|
|
20
20
|
animationType: EchoAnimationType;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
initialBounds: DOMRect;
|
|
21
|
+
id: Key;
|
|
22
|
+
initialBounds: Bound;
|
|
24
23
|
};
|
|
25
24
|
export type IconConfig = {
|
|
26
25
|
type: IconType;
|
|
27
26
|
data: string;
|
|
28
27
|
};
|
|
29
|
-
export type
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
type: KeyType;
|
|
33
|
-
childKeyIds: Array<Keys>;
|
|
28
|
+
export type NonManyKeyConfig = {
|
|
29
|
+
id: Key;
|
|
30
|
+
type: Exclude<KeyType, "MANY">;
|
|
34
31
|
icon: IconConfig;
|
|
32
|
+
ariaLabel: string;
|
|
33
|
+
};
|
|
34
|
+
export type ManyKeyConfig = Omit<NonManyKeyConfig, "type"> & {
|
|
35
|
+
type: Extract<KeyType, "MANY">;
|
|
36
|
+
childKeyIds: ReadonlyArray<string>;
|
|
35
37
|
};
|
|
38
|
+
export type KeyConfig = NonManyKeyConfig | ManyKeyConfig;
|
|
36
39
|
export type KeypadConfiguration = {
|
|
37
40
|
keypadType: KeypadType;
|
|
38
|
-
extraKeys?: ReadonlyArray<
|
|
41
|
+
extraKeys?: ReadonlyArray<Key>;
|
|
39
42
|
};
|
|
40
|
-
export type KeyHandler = (key:
|
|
43
|
+
export type KeyHandler = (key: Key) => Cursor;
|
|
41
44
|
export type Cursor = {
|
|
42
45
|
context: CursorContext;
|
|
43
46
|
};
|
|
@@ -56,7 +59,6 @@ export type ActiveNodesObj = {
|
|
|
56
59
|
focus: string | null;
|
|
57
60
|
};
|
|
58
61
|
export type LayoutProps = {
|
|
59
|
-
initialBounds:
|
|
60
|
-
borders: Border;
|
|
62
|
+
initialBounds: Bound;
|
|
61
63
|
};
|
|
62
64
|
export {};
|
package/dist/types.js.flow
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import Key from "./data/keys";
|
|
8
8
|
import {
|
|
9
9
|
BorderDirection,
|
|
10
10
|
EchoAnimationType,
|
|
@@ -14,42 +14,48 @@ import {
|
|
|
14
14
|
} from "./enums";
|
|
15
15
|
import type { CursorContext } from "./components/input/cursor-contexts";
|
|
16
16
|
export type Border = $Rest<$ReadOnlyArray<BorderDirection>, {}>;
|
|
17
|
-
export
|
|
18
|
-
top: number
|
|
19
|
-
right: number
|
|
20
|
-
bottom: number
|
|
21
|
-
left: number
|
|
22
|
-
height: number
|
|
23
|
-
width: number
|
|
24
|
-
|
|
17
|
+
export interface Bound {
|
|
18
|
+
top: number;
|
|
19
|
+
right: number;
|
|
20
|
+
bottom: number;
|
|
21
|
+
left: number;
|
|
22
|
+
height: number;
|
|
23
|
+
width: number;
|
|
24
|
+
}
|
|
25
25
|
export type Popover = {|
|
|
26
|
-
parentId:
|
|
26
|
+
parentId: Key,
|
|
27
27
|
bounds: $Rest<Bound, {}>,
|
|
28
|
-
childKeyIds: Array<
|
|
28
|
+
childKeyIds: Array<Key>,
|
|
29
29
|
|};
|
|
30
30
|
export type Echo = {|
|
|
31
31
|
animationId: string,
|
|
32
32
|
animationType: EchoAnimationType,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
initialBounds: DOMRect,
|
|
33
|
+
id: Key,
|
|
34
|
+
initialBounds: Bound,
|
|
36
35
|
|};
|
|
37
36
|
export type IconConfig = {|
|
|
38
37
|
type: IconType,
|
|
39
38
|
data: string,
|
|
40
39
|
|};
|
|
41
|
-
export type
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
type: KeyType,
|
|
45
|
-
childKeyIds: Array<Keys>,
|
|
40
|
+
export type NonManyKeyConfig = {|
|
|
41
|
+
id: Key,
|
|
42
|
+
type: Exclude<KeyType, "MANY">,
|
|
46
43
|
icon: IconConfig,
|
|
44
|
+
ariaLabel: string,
|
|
45
|
+
|};
|
|
46
|
+
export type ManyKeyConfig = {|
|
|
47
|
+
...$Diff<NonManyKeyConfig, { type: any }>,
|
|
48
|
+
...{|
|
|
49
|
+
type: Extract<KeyType, "MANY">,
|
|
50
|
+
childKeyIds: $ReadOnlyArray<string>,
|
|
51
|
+
|},
|
|
47
52
|
|};
|
|
53
|
+
export type KeyConfig = NonManyKeyConfig | ManyKeyConfig;
|
|
48
54
|
export type KeypadConfiguration = {|
|
|
49
55
|
keypadType: KeypadType,
|
|
50
|
-
extraKeys?: $ReadOnlyArray<
|
|
56
|
+
extraKeys?: $ReadOnlyArray<Key>,
|
|
51
57
|
|};
|
|
52
|
-
export type KeyHandler = (key:
|
|
58
|
+
export type KeyHandler = (key: Key) => Cursor;
|
|
53
59
|
export type Cursor = {|
|
|
54
60
|
context: CursorContext,
|
|
55
61
|
|};
|
|
@@ -68,6 +74,5 @@ export type ActiveNodesObj = {|
|
|
|
68
74
|
focus: string | null,
|
|
69
75
|
|};
|
|
70
76
|
export type LayoutProps = {|
|
|
71
|
-
initialBounds:
|
|
72
|
-
borders: Border,
|
|
77
|
+
initialBounds: Bound,
|
|
73
78
|
|};
|
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import Keys from "../../../data/keys";
|
|
2
1
|
import {CursorContext} from "../cursor-contexts";
|
|
3
2
|
|
|
4
3
|
import TestMathWrapper from "./test-math-wrapper";
|
|
@@ -27,65 +26,65 @@ describe("Cursor context", () => {
|
|
|
27
26
|
|
|
28
27
|
it("should treat numbers and ternary operators as non-jumpable", () => {
|
|
29
28
|
mathField.pressKey("NUM_1");
|
|
30
|
-
mathField.pressKey(
|
|
29
|
+
mathField.pressKey("CDOT");
|
|
31
30
|
const cursor = mathField.pressKey("NUM_2");
|
|
32
31
|
expect(cursor.context).toEqual(CursorContext.NONE);
|
|
33
32
|
});
|
|
34
33
|
|
|
35
34
|
describe("Before fraction", () => {
|
|
36
35
|
it("should detect when immediately to the left", () => {
|
|
37
|
-
const cursor = mathField.pressKey(
|
|
36
|
+
const cursor = mathField.pressKey("FRAC_EXCLUSIVE");
|
|
38
37
|
expect(cursor.context).toEqual(CursorContext.BEFORE_FRACTION);
|
|
39
38
|
});
|
|
40
39
|
|
|
41
40
|
it("should detect when numbers are between", () => {
|
|
42
41
|
mathField.pressKey("NUM_1");
|
|
43
|
-
mathField.pressKey(
|
|
44
|
-
mathField.pressKey(
|
|
45
|
-
const cursor = mathField.pressKey(
|
|
42
|
+
mathField.pressKey("FRAC_EXCLUSIVE");
|
|
43
|
+
mathField.pressKey("LEFT");
|
|
44
|
+
const cursor = mathField.pressKey("LEFT");
|
|
46
45
|
expect(cursor.context).toEqual(CursorContext.BEFORE_FRACTION);
|
|
47
46
|
});
|
|
48
47
|
|
|
49
48
|
it("should not detect when operators are between", () => {
|
|
50
49
|
mathField.pressKey("NUM_1");
|
|
51
|
-
mathField.pressKey(
|
|
50
|
+
mathField.pressKey("PLUS");
|
|
52
51
|
mathField.pressKey("NUM_2");
|
|
53
|
-
mathField.pressKey(
|
|
54
|
-
mathField.pressKey(
|
|
55
|
-
mathField.pressKey(
|
|
56
|
-
mathField.pressKey(
|
|
57
|
-
const cursor = mathField.pressKey(
|
|
52
|
+
mathField.pressKey("FRAC_EXCLUSIVE");
|
|
53
|
+
mathField.pressKey("LEFT");
|
|
54
|
+
mathField.pressKey("LEFT");
|
|
55
|
+
mathField.pressKey("LEFT");
|
|
56
|
+
const cursor = mathField.pressKey("LEFT");
|
|
58
57
|
expect(cursor.context).toEqual(CursorContext.NONE);
|
|
59
58
|
});
|
|
60
59
|
|
|
61
60
|
it("should not detect when parens are between", () => {
|
|
62
61
|
mathField.pressKey("NUM_1");
|
|
63
|
-
mathField.pressKey(
|
|
64
|
-
mathField.pressKey(
|
|
62
|
+
mathField.pressKey("LEFT_PAREN");
|
|
63
|
+
mathField.pressKey("RIGHT_PAREN");
|
|
65
64
|
mathField.pressKey("NUM_2");
|
|
66
|
-
mathField.pressKey(
|
|
67
|
-
mathField.pressKey(
|
|
68
|
-
mathField.pressKey(
|
|
69
|
-
mathField.pressKey(
|
|
70
|
-
mathField.pressKey(
|
|
71
|
-
const cursor = mathField.pressKey(
|
|
65
|
+
mathField.pressKey("FRAC_EXCLUSIVE");
|
|
66
|
+
mathField.pressKey("LEFT");
|
|
67
|
+
mathField.pressKey("LEFT");
|
|
68
|
+
mathField.pressKey("LEFT");
|
|
69
|
+
mathField.pressKey("LEFT");
|
|
70
|
+
const cursor = mathField.pressKey("LEFT");
|
|
72
71
|
expect(cursor.context).toEqual(CursorContext.NONE);
|
|
73
72
|
});
|
|
74
73
|
});
|
|
75
74
|
|
|
76
75
|
describe("In parens", () => {
|
|
77
76
|
it("should detect when inside empty parens", () => {
|
|
78
|
-
mathField.pressKey(
|
|
79
|
-
mathField.pressKey(
|
|
80
|
-
const cursor = mathField.pressKey(
|
|
77
|
+
mathField.pressKey("LEFT_PAREN");
|
|
78
|
+
mathField.pressKey("RIGHT_PAREN");
|
|
79
|
+
const cursor = mathField.pressKey("LEFT");
|
|
81
80
|
expect(cursor.context).toEqual(CursorContext.IN_PARENS);
|
|
82
81
|
});
|
|
83
82
|
|
|
84
83
|
it("should detect when inside non-empty parens", () => {
|
|
85
|
-
mathField.pressKey(
|
|
84
|
+
mathField.pressKey("LEFT_PAREN");
|
|
86
85
|
mathField.pressKey("NUM_2");
|
|
87
|
-
mathField.pressKey(
|
|
88
|
-
const cursor = mathField.pressKey(
|
|
86
|
+
mathField.pressKey("RIGHT_PAREN");
|
|
87
|
+
const cursor = mathField.pressKey("LEFT");
|
|
89
88
|
expect(cursor.context).toEqual(CursorContext.IN_PARENS);
|
|
90
89
|
});
|
|
91
90
|
});
|
|
@@ -93,13 +92,13 @@ describe("Cursor context", () => {
|
|
|
93
92
|
describe("In superscript", () => {
|
|
94
93
|
it("should detect when inside empty superscript", () => {
|
|
95
94
|
mathField.pressKey("NUM_2");
|
|
96
|
-
const cursor = mathField.pressKey(
|
|
95
|
+
const cursor = mathField.pressKey("EXP");
|
|
97
96
|
expect(cursor.context).toEqual(CursorContext.IN_SUPER_SCRIPT);
|
|
98
97
|
});
|
|
99
98
|
|
|
100
99
|
it("should detect when inside non-empty superscript", () => {
|
|
101
100
|
mathField.pressKey("NUM_2");
|
|
102
|
-
mathField.pressKey(
|
|
101
|
+
mathField.pressKey("EXP");
|
|
103
102
|
const cursor = mathField.pressKey("NUM_3");
|
|
104
103
|
expect(cursor.context).toEqual(CursorContext.IN_SUPER_SCRIPT);
|
|
105
104
|
});
|
|
@@ -107,12 +106,12 @@ describe("Cursor context", () => {
|
|
|
107
106
|
|
|
108
107
|
describe("In subscript", () => {
|
|
109
108
|
it("should detect when inside empty superscript", () => {
|
|
110
|
-
const cursor = mathField.pressKey(
|
|
109
|
+
const cursor = mathField.pressKey("LOG_N");
|
|
111
110
|
expect(cursor.context).toEqual(CursorContext.IN_SUB_SCRIPT);
|
|
112
111
|
});
|
|
113
112
|
|
|
114
113
|
it("should detect when inside non-empty superscript", () => {
|
|
115
|
-
mathField.pressKey(
|
|
114
|
+
mathField.pressKey("LOG_N");
|
|
116
115
|
const cursor = mathField.pressKey("NUM_2");
|
|
117
116
|
expect(cursor.context).toEqual(CursorContext.IN_SUB_SCRIPT);
|
|
118
117
|
});
|
|
@@ -120,12 +119,12 @@ describe("Cursor context", () => {
|
|
|
120
119
|
|
|
121
120
|
describe("In numerator", () => {
|
|
122
121
|
it("should detect when inside empty numerator", () => {
|
|
123
|
-
const cursor = mathField.pressKey(
|
|
122
|
+
const cursor = mathField.pressKey("FRAC_INCLUSIVE");
|
|
124
123
|
expect(cursor.context).toEqual(CursorContext.IN_NUMERATOR);
|
|
125
124
|
});
|
|
126
125
|
|
|
127
126
|
it("should detect when inside non-empty numerator", () => {
|
|
128
|
-
mathField.pressKey(
|
|
127
|
+
mathField.pressKey("FRAC_INCLUSIVE");
|
|
129
128
|
const cursor = mathField.pressKey("NUM_2");
|
|
130
129
|
expect(cursor.context).toEqual(CursorContext.IN_NUMERATOR);
|
|
131
130
|
});
|
|
@@ -133,14 +132,14 @@ describe("Cursor context", () => {
|
|
|
133
132
|
|
|
134
133
|
describe("In denominator", () => {
|
|
135
134
|
it("should detect when inside empty denominator", () => {
|
|
136
|
-
mathField.pressKey(
|
|
137
|
-
const cursor = mathField.pressKey(
|
|
135
|
+
mathField.pressKey("FRAC_INCLUSIVE");
|
|
136
|
+
const cursor = mathField.pressKey("RIGHT");
|
|
138
137
|
expect(cursor.context).toEqual(CursorContext.IN_DENOMINATOR);
|
|
139
138
|
});
|
|
140
139
|
|
|
141
140
|
it("should detect when inside non-empty denominator", () => {
|
|
142
|
-
mathField.pressKey(
|
|
143
|
-
mathField.pressKey(
|
|
141
|
+
mathField.pressKey("FRAC_INCLUSIVE");
|
|
142
|
+
mathField.pressKey("RIGHT");
|
|
144
143
|
const cursor = mathField.pressKey("NUM_2");
|
|
145
144
|
expect(cursor.context).toEqual(CursorContext.IN_DENOMINATOR);
|
|
146
145
|
});
|
|
@@ -149,18 +148,18 @@ describe("Cursor context", () => {
|
|
|
149
148
|
describe("Nesting", () => {
|
|
150
149
|
it("should defer to jumping into fraction if possible", () => {
|
|
151
150
|
// Move inside parens, but include a fraction.
|
|
152
|
-
mathField.pressKey(
|
|
151
|
+
mathField.pressKey("LEFT_PAREN");
|
|
153
152
|
mathField.pressKey("NUM_2");
|
|
154
|
-
mathField.pressKey(
|
|
155
|
-
const cursor = mathField.pressKey(
|
|
153
|
+
mathField.pressKey("FRAC_EXCLUSIVE");
|
|
154
|
+
const cursor = mathField.pressKey("LEFT");
|
|
156
155
|
expect(cursor.context).toEqual(CursorContext.BEFORE_FRACTION);
|
|
157
156
|
});
|
|
158
157
|
|
|
159
158
|
it("should defer to the nearest parent (1)", () => {
|
|
160
159
|
// Move inside parens, inside a superscript.
|
|
161
160
|
mathField.pressKey("NUM_2");
|
|
162
|
-
mathField.pressKey(
|
|
163
|
-
mathField.pressKey(
|
|
161
|
+
mathField.pressKey("EXP");
|
|
162
|
+
mathField.pressKey("LEFT_PAREN");
|
|
164
163
|
const cursor = mathField.pressKey("NUM_3");
|
|
165
164
|
expect(cursor.context).toEqual(CursorContext.IN_PARENS);
|
|
166
165
|
});
|
|
@@ -168,9 +167,9 @@ describe("Cursor context", () => {
|
|
|
168
167
|
it("should defer to the nearest parent (2)", () => {
|
|
169
168
|
// Nest fractions, and put cursor in the denominator of the fraction
|
|
170
169
|
// in the numerator.
|
|
171
|
-
mathField.pressKey(
|
|
172
|
-
mathField.pressKey(
|
|
173
|
-
const cursor = mathField.pressKey(
|
|
170
|
+
mathField.pressKey("FRAC_INCLUSIVE");
|
|
171
|
+
mathField.pressKey("FRAC_INCLUSIVE");
|
|
172
|
+
const cursor = mathField.pressKey("RIGHT");
|
|
174
173
|
expect(cursor.context).toEqual(CursorContext.IN_DENOMINATOR);
|
|
175
174
|
});
|
|
176
175
|
});
|