@khanacademy/math-input 0.5.2 → 0.5.5

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/less/main.less CHANGED
@@ -1,5 +1,5 @@
1
- @import "echo.less";
2
- @import "overrides.less";
3
- @import "popover.less";
1
+ @import "./echo.less";
2
+ @import "./overrides.less";
3
+ @import "./popover.less";
4
4
  @import "../../../node_modules/mathquill/build/mathquill.css";
5
- @import "tabbar.less";
5
+ @import "./tabbar.less";
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Khan Academy's new expression editor for the mobile web.",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "0.5.2",
6
+ "version": "0.5.5",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  /**
2
3
  * Constants that define the various contexts in which a cursor can exist. The
3
4
  * active context is determined first by looking at the cursor's siblings (e.g.,
package/src/index.js CHANGED
@@ -12,3 +12,8 @@ export {
12
12
  } from "./components/prop-types.js";
13
13
  export {default as Keypad} from "./components/provided-keypad.js";
14
14
  export {KeypadTypes} from "./consts.js";
15
+ export {default as KeyConfigs} from "./data/key-configs.js";
16
+
17
+ import * as CursorContexts from "./components/input/cursor-contexts.js";
18
+
19
+ export {CursorContexts};
package/src/utils.js CHANGED
@@ -1,18 +1,15 @@
1
1
  // @flow
2
+ import {getDecimalSeparator} from "@khanacademy/wonder-blocks-i18n";
2
3
 
3
4
  import {DecimalSeparators} from "./consts.js";
4
5
 
5
- // We expect `window.icu` to be exposed by the parent. When in doubt, we fall
6
- // back to a period. We can only depend on a subset of what localeplanet
7
- // provides, however -- the things in `icu-slim.js` (there's a copy in ../lib/
8
- // for reference).
9
- export let decimalSeparator: string;
10
- if (
11
- typeof window !== "undefined" &&
12
- window.icu &&
13
- window.icu.getDecimalFormatSymbols().decimal_separator === ","
14
- ) {
15
- decimalSeparator = DecimalSeparators.COMMA;
16
- } else {
17
- decimalSeparator = DecimalSeparators.PERIOD;
18
- }
6
+ // NOTES(kevinb):
7
+ // - In order to get the correct decimal separator for the current locale,
8
+ // the locale must bet set using `setLocale(kaLocale)` which can be
9
+ // imported from wonder-blocks-i18n.
10
+ // - Some languages/locales use different decimal separators than the ones
11
+ // listed here. Much of the Arab world uses U+066C.
12
+ export const decimalSeparator: string =
13
+ getDecimalSeparator() === ","
14
+ ? DecimalSeparators.COMMA
15
+ : DecimalSeparators.PERIOD;