@pie-lib/math-toolbar 2.0.0-beta.3 → 2.1.0-next.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.json +2 -847
- package/CHANGELOG.md +196 -128
- package/LICENSE.md +5 -0
- package/NEXT.CHANGELOG.json +1 -0
- package/lib/__tests__/editor-and-pad.test.js +19 -0
- package/lib/__tests__/index.test.js +27 -0
- package/lib/__tests__/math-preview.test.js +25 -0
- package/lib/done-button.js +34 -39
- package/lib/done-button.js.map +1 -1
- package/lib/editor-and-pad.js +271 -334
- package/lib/editor-and-pad.js.map +1 -1
- package/lib/index.js +40 -44
- package/lib/index.js.map +1 -1
- package/lib/math-preview.js +165 -185
- package/lib/math-preview.js.map +1 -1
- package/lib/utils.js +17 -0
- package/lib/utils.js.map +1 -0
- package/package.json +13 -11
- package/src/__tests__/editor-and-pad.test.js +16 -0
- package/src/__tests__/index.test.js +21 -0
- package/src/__tests__/math-preview.test.js +22 -0
- package/src/done-button.jsx +27 -33
- package/src/editor-and-pad.jsx +242 -342
- package/src/index.jsx +23 -16
- package/src/math-preview.jsx +142 -183
- package/src/utils.js +11 -0
package/src/done-button.jsx
CHANGED
|
@@ -1,47 +1,41 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import IconButton from '@material
|
|
4
|
-
import Check from '@
|
|
5
|
-
import {
|
|
3
|
+
import IconButton from '@mui/material/IconButton';
|
|
4
|
+
import Check from '@mui/icons-material/Check';
|
|
5
|
+
import { styled } from '@mui/material/styles';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import classNames from 'classnames';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const StyledIconButton = styled(IconButton)(({ theme, hideBackground }) => ({
|
|
9
|
+
verticalAlign: 'top',
|
|
10
|
+
width: '28px',
|
|
11
|
+
height: '28px',
|
|
12
|
+
color: '#00bb00',
|
|
13
|
+
...(hideBackground && {
|
|
14
|
+
backgroundColor: theme.palette.common.white,
|
|
15
|
+
'&:hover': {
|
|
16
|
+
backgroundColor: theme.palette.grey[200],
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
'& .MuiIconButton-label': {
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
top: '2px',
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
export const RawDoneButton = ({ onClick, hideBackground }) => (
|
|
26
|
+
<StyledIconButton
|
|
11
27
|
aria-label="Done"
|
|
12
|
-
className={classes.iconRoot}
|
|
13
28
|
onClick={onClick}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
root: classNames(classes.iconRoot, { [classes.hideBackground]: hideBackground }),
|
|
17
|
-
}}
|
|
29
|
+
hideBackground={hideBackground}
|
|
30
|
+
size="large"
|
|
18
31
|
>
|
|
19
32
|
<Check />
|
|
20
|
-
</
|
|
33
|
+
</StyledIconButton>
|
|
21
34
|
);
|
|
22
35
|
|
|
23
36
|
RawDoneButton.propTypes = {
|
|
24
|
-
classes: PropTypes.object.isRequired,
|
|
25
37
|
onClick: PropTypes.func,
|
|
38
|
+
hideBackground: PropTypes.bool,
|
|
26
39
|
};
|
|
27
40
|
|
|
28
|
-
const
|
|
29
|
-
iconRoot: {
|
|
30
|
-
verticalAlign: 'top',
|
|
31
|
-
width: '28px',
|
|
32
|
-
height: '28px',
|
|
33
|
-
color: '#00bb00',
|
|
34
|
-
},
|
|
35
|
-
hideBackground: {
|
|
36
|
-
backgroundColor: theme.palette.common.white,
|
|
37
|
-
|
|
38
|
-
'&:hover': {
|
|
39
|
-
backgroundColor: theme.palette.grey[200],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
label: {
|
|
43
|
-
position: 'absolute',
|
|
44
|
-
top: '2px',
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
export const DoneButton = withStyles(styles)(RawDoneButton);
|
|
41
|
+
export const DoneButton = RawDoneButton;
|