@khanacademy/math-input 14.2.0 → 14.2.2
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 +22 -0
- package/dist/es/index.js +18 -19
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +17 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/aphrodite-css-transition-group/transition-child.tsx +2 -1
- package/src/components/keypad/keypad-pages/keypad-pages.stories.tsx +9 -2
- package/src/components/keypad/keypad.tsx +2 -2
- package/src/components/keypad/navigation-pad.stories.tsx +2 -1
- package/src/components/keypad-context.tsx +25 -16
- package/src/components/keypad-legacy/text-icon.tsx +1 -1
- package/src/full-keypad.stories.tsx +7 -1
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 14.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#787](https://github.com/Khan/perseus/pull/787) [`ed00ee59`](https://github.com/Khan/perseus/commit/ed00ee59dcdeb20a66709c6b7d3474da55d58e4d) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix a bug where the mobile keypad didn't animate in the first time it appeared.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`79403e06`](https://github.com/Khan/perseus/commit/79403e06eedb597d7818d6c858bbba6f51ff3fe1)]:
|
|
10
|
+
- @khanacademy/perseus-core@1.3.0
|
|
11
|
+
|
|
12
|
+
## 14.2.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#759](https://github.com/Khan/perseus/pull/759) [`c431c4b8`](https://github.com/Khan/perseus/commit/c431c4b8147ae0630df2d2b19b0f5a5b5f04d4bf) Thanks [@handeyeco](https://github.com/handeyeco)! - Remove references to unused font families
|
|
17
|
+
|
|
18
|
+
* [#764](https://github.com/Khan/perseus/pull/764) [`fb84640d`](https://github.com/Khan/perseus/commit/fb84640de911a8e8817829985fe9956e83a7f7d1) Thanks [@handeyeco](https://github.com/handeyeco)! - Use useMemo in keypad context to avoid needless rerenders
|
|
19
|
+
|
|
20
|
+
- [#767](https://github.com/Khan/perseus/pull/767) [`33cc24c3`](https://github.com/Khan/perseus/commit/33cc24c33f62cd87de7594ba575d311fd465e2e0) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Small comment fixes in the math keypad
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`376eb0e4`](https://github.com/Khan/perseus/commit/376eb0e4aaaa4c7a90fd6107a84bb74d382b077c)]:
|
|
23
|
+
- @khanacademy/perseus-core@1.2.0
|
|
24
|
+
|
|
3
25
|
## 14.2.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/es/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getDecimalSeparator } from '@khanacademy/wonder-blocks-i18n';
|
|
|
5
5
|
import { entries } from '@khanacademy/wonder-stuff-core';
|
|
6
6
|
import { StyleSheet, css } from 'aphrodite';
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import { useEffect, useState } from 'react';
|
|
8
|
+
import { useEffect, useState, useMemo } from 'react';
|
|
9
9
|
import ReactDOM from 'react-dom';
|
|
10
10
|
import $ from 'jquery';
|
|
11
11
|
import MathQuill from 'mathquill';
|
|
@@ -20,7 +20,7 @@ import * as Redux from 'redux';
|
|
|
20
20
|
|
|
21
21
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
22
22
|
const libName = "@khanacademy/math-input";
|
|
23
|
-
const libVersion = "14.2.
|
|
23
|
+
const libVersion = "14.2.2";
|
|
24
24
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
25
25
|
|
|
26
26
|
function _extends() {
|
|
@@ -4962,7 +4962,7 @@ function getAvailableTabs(props) {
|
|
|
4962
4962
|
// The main (v2) Keypad. Use this component to present an accessible, onscreen
|
|
4963
4963
|
// keypad to learners for entering math expressions.
|
|
4964
4964
|
function Keypad$2(props) {
|
|
4965
|
-
// If we're using the Fractions
|
|
4965
|
+
// If we're using the Fractions keypad, we want to default select that page
|
|
4966
4966
|
// Otherwise, we want to default to the Numbers page
|
|
4967
4967
|
const defaultSelectedPage = props.fractionsOnly ? "Fractions" : "Numbers";
|
|
4968
4968
|
const [selectedPage, setSelectedPage] = React.useState(defaultSelectedPage);
|
|
@@ -4989,7 +4989,7 @@ function Keypad$2(props) {
|
|
|
4989
4989
|
// Use a different grid for our fraction keypad
|
|
4990
4990
|
const gridStyle = fractionsOnly ? styles$d.fractionsGrid : styles$d.expressionGrid;
|
|
4991
4991
|
|
|
4992
|
-
// This
|
|
4992
|
+
// This useEffect is only used to ensure that we can test the keypad in storybook
|
|
4993
4993
|
useEffect(() => {
|
|
4994
4994
|
setSelectedPage(defaultSelectedPage);
|
|
4995
4995
|
}, [fractionsOnly, defaultSelectedPage]);
|
|
@@ -5295,7 +5295,8 @@ class TransitionChild extends React.Component {
|
|
|
5295
5295
|
}
|
|
5296
5296
|
queueClass(removeClassName, addClassName) {
|
|
5297
5297
|
this.classNameQueue.push([removeClassName, addClassName]);
|
|
5298
|
-
|
|
5298
|
+
// Queue operation for after the next paint.
|
|
5299
|
+
this.props.schedule.timeout(this.flushClassNameQueue, 0);
|
|
5299
5300
|
}
|
|
5300
5301
|
render() {
|
|
5301
5302
|
const {
|
|
@@ -5575,20 +5576,18 @@ function StatefulKeypadContextProvider(props) {
|
|
|
5575
5576
|
// this is a KeypadContextRendererInterface from Perseus
|
|
5576
5577
|
const [renderer, setRenderer] = useState();
|
|
5577
5578
|
const [scrollableElement, setScrollableElement] = useState();
|
|
5579
|
+
const memoizedValue = useMemo(() => ({
|
|
5580
|
+
keypadActive,
|
|
5581
|
+
setKeypadActive,
|
|
5582
|
+
keypadElement,
|
|
5583
|
+
setKeypadElement,
|
|
5584
|
+
renderer,
|
|
5585
|
+
setRenderer,
|
|
5586
|
+
scrollableElement,
|
|
5587
|
+
setScrollableElement
|
|
5588
|
+
}), [keypadActive, setKeypadActive, keypadElement, setKeypadElement, renderer, setRenderer, scrollableElement, setScrollableElement]);
|
|
5578
5589
|
return /*#__PURE__*/React.createElement(KeypadContext.Provider, {
|
|
5579
|
-
value:
|
|
5580
|
-
setKeypadActive,
|
|
5581
|
-
keypadActive,
|
|
5582
|
-
setKeypadElement,
|
|
5583
|
-
keypadElement,
|
|
5584
|
-
setRenderer,
|
|
5585
|
-
renderer,
|
|
5586
|
-
// The scrollableElement options can likely be removed after
|
|
5587
|
-
// the exercises-package is officially deprecated. They don't appear
|
|
5588
|
-
// to be used anywhere except for the exercises-package and tests.
|
|
5589
|
-
setScrollableElement,
|
|
5590
|
-
scrollableElement
|
|
5591
|
-
}
|
|
5590
|
+
value: memoizedValue
|
|
5592
5591
|
}, props.children);
|
|
5593
5592
|
}
|
|
5594
5593
|
|
|
@@ -7030,7 +7029,7 @@ const styles$9 = StyleSheet.create({
|
|
|
7030
7029
|
width: iconSizeWidthPx
|
|
7031
7030
|
},
|
|
7032
7031
|
base: {
|
|
7033
|
-
fontFamily: "
|
|
7032
|
+
fontFamily: "'Lato', sans-serif",
|
|
7034
7033
|
fontSize: 25
|
|
7035
7034
|
}
|
|
7036
7035
|
});
|