@khanacademy/math-input 19.2.1 → 20.0.1

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.
@@ -11,6 +11,6 @@ type I18nContextType = {
11
11
  };
12
12
  export declare const MathInputI18nContext: React.Context<I18nContextType>;
13
13
  type Props = React.PropsWithChildren<I18nContextType>;
14
- export declare function MathInputI18nContextProvider({ children, strings, locale, }: Props): JSX.Element;
14
+ export declare function MathInputI18nContextProvider({ children, strings, locale, }: Props): React.JSX.Element;
15
15
  export declare const useMathInputI18n: () => I18nContextType;
16
16
  export {};
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type Key from "../../../data/keys";
3
3
  import type { ClickKeyCallback } from "../../../types";
4
4
  type Props = {
5
5
  extraKeys: ReadonlyArray<Key>;
6
6
  onClickKey: ClickKeyCallback;
7
7
  };
8
- export default function ExtrasPage(props: Props): JSX.Element;
8
+ export default function ExtrasPage(props: Props): React.JSX.Element;
9
9
  export {};
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { ClickKeyCallback } from "../../../types";
3
3
  import type { CursorContext } from "../../input/cursor-contexts";
4
4
  type Props = {
5
5
  onClickKey: ClickKeyCallback;
6
6
  cursorContext?: (typeof CursorContext)[keyof typeof CursorContext];
7
7
  };
8
- export default function FractionsPage(props: Props): JSX.Element;
8
+ export default function FractionsPage(props: Props): React.JSX.Element;
9
9
  export {};
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { ClickKeyCallback } from "../../../types";
3
3
  type Props = {
4
4
  onClickKey: ClickKeyCallback;
5
5
  };
6
- export default function GeometryPage(props: Props): JSX.Element;
6
+ export default function GeometryPage(props: Props): React.JSX.Element;
7
7
  export {};
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { ClickKeyCallback } from "../../../types";
3
3
  type Props = {
4
4
  onClickKey: ClickKeyCallback;
5
5
  };
6
- export default function NumbersPage(props: Props): JSX.Element;
6
+ export default function NumbersPage(props: Props): React.JSX.Element;
7
7
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { ClickKeyCallback } from "../../../types";
3
3
  type Props = {
4
4
  onClickKey: ClickKeyCallback;
@@ -7,5 +7,5 @@ type Props = {
7
7
  basicRelations?: boolean;
8
8
  advancedRelations?: boolean;
9
9
  };
10
- export default function OperatorsPage(props: Props): JSX.Element;
10
+ export default function OperatorsPage(props: Props): React.JSX.Element;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type Key from "../../data/keys";
3
3
  import type { ClickKeyCallback } from "../../types";
4
4
  import type { CursorContext } from "../input/cursor-contexts";
@@ -19,7 +19,7 @@ export type Props = {
19
19
  onClickKey: ClickKeyCallback;
20
20
  onAnalyticsEvent: AnalyticsEventHandlerFn;
21
21
  };
22
- declare function Keypad(props: Props): JSX.Element;
22
+ declare function Keypad(props: Props): React.JSX.Element;
23
23
  declare namespace Keypad {
24
24
  var defaultProps: {
25
25
  extraKeys: never[];
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
2
  import MobileKeypadInternals from "./mobile-keypad-internals";
3
3
  type Props = Omit<React.ComponentProps<typeof MobileKeypadInternals>, "keypadActive" | "setKeypadActive">;
4
- export declare function MobileKeypad(props: Props): JSX.Element;
4
+ export declare function MobileKeypad(props: Props): React.JSX.Element;
5
5
  export {};
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { KeyConfig, ClickKeyCallback } from "../../types";
3
3
  export type KeypadButtonProps = {
4
4
  coord: readonly [number, number];
5
5
  keyConfig: KeyConfig;
6
6
  onClickKey: ClickKeyCallback;
7
7
  };
8
- export default function NavigationButton({ coord, keyConfig, onClickKey, }: KeypadButtonProps): JSX.Element;
8
+ export default function NavigationButton({ coord, keyConfig, onClickKey, }: KeypadButtonProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { ClickKeyCallback } from "../../types";
3
3
  export type Props = {
4
4
  onClickKey: ClickKeyCallback;
5
5
  };
6
- export default function NavigationPad(props: Props): JSX.Element;
6
+ export default function NavigationPad(props: Props): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import type { ClickKeyCallback, KeypadPageType } from "../../types";
3
3
  import type { CursorContext } from "../input/cursor-contexts";
4
4
  type Props = {
@@ -8,5 +8,5 @@ type Props = {
8
8
  convertDotToTimes?: boolean;
9
9
  divisionKey?: boolean;
10
10
  };
11
- export default function SharedKeys(props: Props): JSX.Element;
11
+ export default function SharedKeys(props: Props): React.JSX.Element;
12
12
  export {};
@@ -11,5 +11,5 @@ import * as React from "react";
11
11
  import type { KeypadContextType } from "../types";
12
12
  export declare const KeypadContext: React.Context<KeypadContextType>;
13
13
  type Props = React.PropsWithChildren<unknown>;
14
- export declare function StatefulKeypadContextProvider(props: Props): JSX.Element;
14
+ export declare function StatefulKeypadContextProvider(props: Props): React.JSX.Element;
15
15
  export {};
@@ -6,6 +6,8 @@ import type { MathInputStrings } from "../strings";
6
6
  import type { KeyConfig } from "../types";
7
7
  declare const KeyConfigs: (strings: MathInputStrings) => {
8
8
  MANY: KeyConfig;
9
+ x: KeyConfig;
10
+ y: KeyConfig;
9
11
  a: KeyConfig;
10
12
  b: KeyConfig;
11
13
  i: KeyConfig;
@@ -14,8 +16,6 @@ declare const KeyConfigs: (strings: MathInputStrings) => {
14
16
  s: KeyConfig;
15
17
  u: KeyConfig;
16
18
  g: KeyConfig;
17
- x: KeyConfig;
18
- y: KeyConfig;
19
19
  PLUS: KeyConfig;
20
20
  MINUS: KeyConfig;
21
21
  NEGATIVE: KeyConfig;
package/dist/es/index.js CHANGED
@@ -15,7 +15,7 @@ import PropTypes from 'prop-types';
15
15
 
16
16
  // This file is processed by a Rollup plugin (replace) to inject the production
17
17
  const libName = "@khanacademy/math-input";
18
- const libVersion = "19.2.1";
18
+ const libVersion = "20.0.1";
19
19
  addLibraryVersionToPerseusDebug(libName, libVersion);
20
20
 
21
21
  function _extends() {
@@ -2609,25 +2609,11 @@ function TabbarItem(props) {
2609
2609
  } = props;
2610
2610
  const tabRef = useRef(null);
2611
2611
  useEffect(() => {
2612
- let timeout;
2613
2612
  if (role === "tab" && focus) {
2614
- /**
2615
- * When tabs are within a WonderBlocks Popover component, the
2616
- * manner in which the component is rendered and moved causes
2617
- * focus to snap to the bottom of the page on first focus.
2618
- *
2619
- * This timeout moves around that by delaying the focus enough
2620
- * to wait for the WonderBlock Popover to move to the correct
2621
- * location and scroll the user to the correct location.
2622
- * */
2623
- timeout = setTimeout(() => {
2624
- if (tabRef != null && tabRef.current) {
2625
- // Move element into view when it is focused
2626
- tabRef == null || tabRef.current.focus();
2627
- }
2628
- }, 0);
2613
+ var _tabRef$current;
2614
+ // Move element into view when it is focused
2615
+ tabRef == null || (_tabRef$current = tabRef.current) == null || _tabRef$current.focus();
2629
2616
  }
2630
- return () => clearTimeout(timeout);
2631
2617
  }, [role, focus, tabRef]);
2632
2618
  return /*#__PURE__*/React.createElement(Clickable, {
2633
2619
  onClick: onClick,