@khanacademy/math-input 8.1.2 → 8.1.3

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,11 @@
1
1
  # @khanacademy/math-input
2
2
 
3
+ ## 8.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 302ca7f7: Fix type for parameters of `moveOutOf` event.
8
+
3
9
  ## 8.1.2
4
10
 
5
11
  ### Patch Changes
@@ -148,7 +148,7 @@ export type MathFieldConfig = {
148
148
  handlers?: {
149
149
  edit?: (mathField: MathFieldInterface) => void;
150
150
  enter?: (mathField: MathFieldInterface) => void;
151
- moveOutOf?: (mathField: MathFieldInterface) => void;
151
+ moveOutOf?: (direction: MathQuillDirection, mathField: MathFieldInterface) => void;
152
152
  upOutOf?: (mathField: MathFieldInterface) => void;
153
153
  downOutOf?: (mathField: MathFieldInterface) => void;
154
154
  deleteOutOf?: (direction: MathQuillDirection, mathField: MathFieldInterface) => void;
@@ -171,7 +171,10 @@ export type MathFieldConfig = {|
171
171
  handlers?: {|
172
172
  edit?: (mathField: MathFieldInterface) => void,
173
173
  enter?: (mathField: MathFieldInterface) => void,
174
- moveOutOf?: (mathField: MathFieldInterface) => void,
174
+ moveOutOf?: (
175
+ direction: MathQuillDirection,
176
+ mathField: MathFieldInterface
177
+ ) => void,
175
178
  upOutOf?: (mathField: MathFieldInterface) => void,
176
179
  downOutOf?: (mathField: MathFieldInterface) => void,
177
180
  deleteOutOf?: (
@@ -1,8 +1,8 @@
1
1
  import { StyleType } from "@khanacademy/wonder-blocks-core";
2
2
  import * as React from "react";
3
3
  import ReactDOM from "react-dom";
4
- import Key from "../../data/keys";
5
- import { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
4
+ import type Key from "../../data/keys";
5
+ import type { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
6
6
  /**
7
7
  * This is the v2 equivalent of v1's ProvidedKeypad. It follows the same
8
8
  * external API so that it can be hot-swapped with the v1 keypad and
@@ -8,7 +8,7 @@ import { StyleType } from "@khanacademy/wonder-blocks-core";
8
8
  import * as React from "react";
9
9
  import ReactDOM from "react-dom";
10
10
  import Key from "../../data/keys";
11
- import {
11
+ import type {
12
12
  Cursor,
13
13
  KeypadConfiguration,
14
14
  KeyHandler,
@@ -0,0 +1,12 @@
1
+ /**
2
+ * React PropTypes that may be shared between components.
3
+ */
4
+ import PropTypes from "prop-types";
5
+ export declare const keypadElementPropType: PropTypes.Requireable<PropTypes.InferProps<{
6
+ activate: PropTypes.Validator<(...args: any[]) => any>;
7
+ dismiss: PropTypes.Validator<(...args: any[]) => any>;
8
+ configure: PropTypes.Validator<(...args: any[]) => any>;
9
+ setCursor: PropTypes.Validator<(...args: any[]) => any>;
10
+ setKeyHandler: PropTypes.Validator<(...args: any[]) => any>;
11
+ getDOMNode: PropTypes.Validator<(...args: any[]) => any>;
12
+ }>>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ import PropTypes from "prop-types";
8
+ declare export var keypadElementPropType: PropTypes.Requireable<
9
+ PropTypes.InferProps<{|
10
+ activate: PropTypes.Validator<(...args: any[]) => any>,
11
+ dismiss: PropTypes.Validator<(...args: any[]) => any>,
12
+ configure: PropTypes.Validator<(...args: any[]) => any>,
13
+ setCursor: PropTypes.Validator<(...args: any[]) => any>,
14
+ setKeyHandler: PropTypes.Validator<(...args: any[]) => any>,
15
+ getDOMNode: PropTypes.Validator<(...args: any[]) => any>,
16
+ |}>
17
+ >;
package/dist/es/index.js CHANGED
@@ -8836,6 +8836,7 @@ const context = /*#__PURE__*/React.createContext({
8836
8836
  */
8837
8837
 
8838
8838
  // NOTE(jared): This is no longer guaranteed to be React element
8839
+ // @deprecated Use `KeypadAPI` Typescript interface instead.
8839
8840
  const keypadElementPropType = PropTypes.shape({
8840
8841
  activate: PropTypes.func.isRequired,
8841
8842
  dismiss: PropTypes.func.isRequired,