@khanacademy/math-input 7.0.0 → 8.1.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @khanacademy/math-input
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5611204a: Adds back the export of the unwrapped keypad for Khanmigo
8
+ - b4430dce: Make sendEvent in the Keypad an optional param
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [b4c06409]
13
+ - @khanacademy/perseus-core@0.1.0
14
+
15
+ ## 8.0.0
16
+
17
+ ### Major Changes
18
+
19
+ - f9ee9d24: Move KeypadContext from Perseus to MathInput
20
+ - b18986d3: Replace Legacy/Mobile keypads with a component that switches between them
21
+
3
22
  ## 7.0.0
4
23
 
5
24
  ### Major Changes
@@ -15,7 +15,7 @@ export type Props = {
15
15
  basicRelations?: boolean;
16
16
  advancedRelations?: boolean;
17
17
  onClickKey: ClickKeyCallback;
18
- sendEvent: SendEventFn;
18
+ sendEvent?: SendEventFn;
19
19
  };
20
20
  declare function Keypad(props: Props): JSX.Element;
21
21
  declare namespace Keypad {
@@ -23,7 +23,7 @@ export type Props = {|
23
23
  basicRelations?: boolean,
24
24
  advancedRelations?: boolean,
25
25
  onClickKey: ClickKeyCallback,
26
- sendEvent: SendEventFn,
26
+ sendEvent?: SendEventFn,
27
27
  |};
28
28
  declare var Keypad: typeof npm$namespace$Keypad;
29
29
 
@@ -0,0 +1,20 @@
1
+ /**
2
+ * KeypadContext provides a way to the Keypad and (Server)ItemRenderer to
3
+ * communicate.
4
+ *
5
+ * The KeypadContext.Provider wraps the ExerciseFooter while KeypadContext.Consumer
6
+ * wraps each (Server)ItemRenderer render site and the Keypad rendered in the
7
+ * ExerciseFooter.
8
+ */
9
+ import * as React from "react";
10
+ import type { RendererInterface } from "@khanacademy/perseus-core";
11
+ type KeypadContext = {
12
+ setKeypadElement: (keypadElement?: HTMLElement | null | undefined) => void;
13
+ keypadElement: HTMLElement | null | undefined;
14
+ setRenderer: (renderer?: RendererInterface | null | undefined) => void;
15
+ renderer: RendererInterface | null | undefined;
16
+ setScrollableElement: (scrollableElement?: HTMLElement | null | undefined) => void;
17
+ scrollableElement: HTMLElement | null | undefined;
18
+ };
19
+ declare const context: React.Context<KeypadContext>;
20
+ export default context;
@@ -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 { RendererInterface } from "@khanacademy/perseus-core";
9
+ declare type KeypadContext = {|
10
+ setKeypadElement: (keypadElement?: HTMLElement | null | void) => void,
11
+ keypadElement: HTMLElement | null | void,
12
+ setRenderer: (renderer?: RendererInterface | null | void) => void,
13
+ renderer: RendererInterface | null | void,
14
+ setScrollableElement: (scrollableElement?: HTMLElement | null | void) => void,
15
+ scrollableElement: HTMLElement | null | void,
16
+ |};
17
+ declare var context: React.Context<KeypadContext>;
18
+ declare export default typeof context;
@@ -44,9 +44,9 @@ declare class KeypadButton extends React.PureComponent<Props> {
44
44
  }
45
45
  declare const _default: import("react-redux").ConnectedComponent<typeof KeypadButton, import("react-redux").Omit<Pick<React.ClassAttributes<KeypadButton> & Props, "style" | "ref" | "ariaLabel" | "onTouchCancel" | "onTouchEnd" | "onTouchMove" | "onTouchStart" | "type" | "icon" | "key" | "heightPx" | "widthPx"> & {
46
46
  focused?: boolean | undefined;
47
+ disabled?: boolean | undefined;
47
48
  borders?: readonly (BorderDirection | undefined)[] | undefined;
48
49
  childKeys?: readonly NonManyKeyConfig[] | undefined;
49
- disabled?: boolean | undefined;
50
50
  popoverEnabled?: boolean | undefined;
51
51
  } & {}, "heightPx" | "widthPx">>;
52
52
  export default _default;
@@ -67,9 +67,9 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
67
67
  >,
68
68
  ...{|
69
69
  focused?: boolean | void,
70
+ disabled?: boolean | void,
70
71
  borders?: $ReadOnlyArray<BorderDirection | void> | void,
71
72
  childKeys?: $ReadOnlyArray<NonManyKeyConfig> | void,
72
- disabled?: boolean | void,
73
73
  popoverEnabled?: boolean | void,
74
74
  |},
75
75
  ...{||},
@@ -35,5 +35,5 @@ declare class KeypadContainer extends React.Component<Props, State> {
35
35
  renderKeypad: () => JSX.Element;
36
36
  render(): JSX.Element;
37
37
  }
38
- declare const _default: import("react-redux").ConnectedComponent<typeof KeypadContainer, import("react-redux").Omit<React.ClassAttributes<KeypadContainer> & Props, "active" | "extraKeys" | "onPageSizeChange" | "keypadType" | "layoutMode" | "navigationPadEnabled">>;
38
+ declare const _default: import("react-redux").ConnectedComponent<typeof KeypadContainer, import("react-redux").Omit<React.ClassAttributes<KeypadContainer> & Props, "active" | "extraKeys" | "keypadType" | "onPageSizeChange" | "layoutMode" | "navigationPadEnabled">>;
39
39
  export default _default;
@@ -48,8 +48,8 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
48
48
  {| ...React.ClassAttributes<KeypadContainer>, ...Props |},
49
49
  | "active"
50
50
  | "extraKeys"
51
- | "onPageSizeChange"
52
51
  | "keypadType"
52
+ | "onPageSizeChange"
53
53
  | "layoutMode"
54
54
  | "navigationPadEnabled"
55
55
  >
@@ -27,5 +27,5 @@ declare class Keypad extends React.Component<Props> {
27
27
  _onResize: () => void;
28
28
  render(): JSX.Element;
29
29
  }
30
- declare const _default: import("react-redux").ConnectedComponent<typeof Keypad, import("react-redux").Omit<React.ClassAttributes<Keypad> & Props, "popover" | "active" | "echoes" | "removeEcho">>;
30
+ declare const _default: import("react-redux").ConnectedComponent<typeof Keypad, import("react-redux").Omit<React.ClassAttributes<Keypad> & Props, "active" | "popover" | "echoes" | "removeEcho">>;
31
31
  export default _default;
@@ -34,7 +34,7 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
34
34
  typeof Keypad,
35
35
  $Flowgen$Import$react_2d_redux.Omit<
36
36
  {| ...React.ClassAttributes<Keypad>, ...Props |},
37
- "popover" | "active" | "echoes" | "removeEcho"
37
+ "active" | "popover" | "echoes" | "removeEcho"
38
38
  >
39
39
  >;
40
40
  declare export default typeof _default;
@@ -33,5 +33,5 @@ declare class TouchableKeypadButton extends React.Component<Props> {
33
33
  componentWillUnmount(): void;
34
34
  render(): JSX.Element;
35
35
  }
36
- declare const _default: import("react-redux").ConnectedComponent<typeof TouchableKeypadButton, import("react-redux").Omit<React.ClassAttributes<TouchableKeypadButton> & Props, "style" | "ariaLabel" | "type" | "id" | "icon" | "focused" | "childKeyIds" | "borders" | "childKeys" | "disabled" | "popoverEnabled" | "gestureManager"> & OwnProps>;
36
+ declare const _default: import("react-redux").ConnectedComponent<typeof TouchableKeypadButton, import("react-redux").Omit<React.ClassAttributes<TouchableKeypadButton> & Props, "style" | "ariaLabel" | "type" | "id" | "icon" | "focused" | "disabled" | "childKeyIds" | "borders" | "childKeys" | "popoverEnabled" | "gestureManager"> & OwnProps>;
37
37
  export default _default;
@@ -46,10 +46,10 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
46
46
  | "id"
47
47
  | "icon"
48
48
  | "focused"
49
+ | "disabled"
49
50
  | "childKeyIds"
50
51
  | "borders"
51
52
  | "childKeys"
52
- | "disabled"
53
53
  | "popoverEnabled"
54
54
  | "gestureManager"
55
55
  >,
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { StyleType } from "@khanacademy/wonder-blocks-core";
3
+ type Props = {
4
+ onElementMounted?: (arg1: any) => void;
5
+ onDismiss?: () => void;
6
+ style?: StyleType;
7
+ useV2Keypad?: boolean;
8
+ };
9
+ declare function KeypadSwitch(props: Props): JSX.Element;
10
+ export default KeypadSwitch;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ import { StyleType } from "@khanacademy/wonder-blocks-core";
8
+ declare type Props = {|
9
+ onElementMounted?: (arg1: any) => void,
10
+ onDismiss?: () => void,
11
+ style?: StyleType,
12
+ useV2Keypad?: boolean,
13
+ |};
14
+ declare function KeypadSwitch(props: Props): React$Node;
15
+ declare export default typeof KeypadSwitch;