@khanacademy/math-input 14.2.0 → 14.2.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.
- package/CHANGELOG.md +13 -0
- package/dist/es/index.js +16 -18
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +15 -17
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- 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,18 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 14.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
|
|
9
|
+
* [#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
|
|
10
|
+
|
|
11
|
+
- [#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
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`376eb0e4`](https://github.com/Khan/perseus/commit/376eb0e4aaaa4c7a90fd6107a84bb74d382b077c)]:
|
|
14
|
+
- @khanacademy/perseus-core@1.2.0
|
|
15
|
+
|
|
3
16
|
## 14.2.0
|
|
4
17
|
|
|
5
18
|
### 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.1";
|
|
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]);
|
|
@@ -5575,20 +5575,18 @@ function StatefulKeypadContextProvider(props) {
|
|
|
5575
5575
|
// this is a KeypadContextRendererInterface from Perseus
|
|
5576
5576
|
const [renderer, setRenderer] = useState();
|
|
5577
5577
|
const [scrollableElement, setScrollableElement] = useState();
|
|
5578
|
+
const memoizedValue = useMemo(() => ({
|
|
5579
|
+
keypadActive,
|
|
5580
|
+
setKeypadActive,
|
|
5581
|
+
keypadElement,
|
|
5582
|
+
setKeypadElement,
|
|
5583
|
+
renderer,
|
|
5584
|
+
setRenderer,
|
|
5585
|
+
scrollableElement,
|
|
5586
|
+
setScrollableElement
|
|
5587
|
+
}), [keypadActive, setKeypadActive, keypadElement, setKeypadElement, renderer, setRenderer, scrollableElement, setScrollableElement]);
|
|
5578
5588
|
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
|
-
}
|
|
5589
|
+
value: memoizedValue
|
|
5592
5590
|
}, props.children);
|
|
5593
5591
|
}
|
|
5594
5592
|
|
|
@@ -7030,7 +7028,7 @@ const styles$9 = StyleSheet.create({
|
|
|
7030
7028
|
width: iconSizeWidthPx
|
|
7031
7029
|
},
|
|
7032
7030
|
base: {
|
|
7033
|
-
fontFamily: "
|
|
7031
|
+
fontFamily: "'Lato', sans-serif",
|
|
7034
7032
|
fontSize: 25
|
|
7035
7033
|
}
|
|
7036
7034
|
});
|