@pie-lib/math-toolbar 2.1.0-next.2 → 2.1.0-next.30
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 +8 -0
- package/lib/done-button.js +61 -0
- package/lib/done-button.js.map +1 -0
- package/lib/editor-and-pad.js +545 -0
- package/lib/editor-and-pad.js.map +1 -0
- package/lib/index.js +243 -0
- package/lib/index.js.map +1 -0
- package/lib/math-preview.js +203 -0
- package/lib/math-preview.js.map +1 -0
- package/lib/utils.js +21 -0
- package/lib/utils.js.map +1 -0
- package/package.json +5 -5
- package/src/__tests__/math-preview.test.js +1 -5
- package/src/math-preview.jsx +3 -5
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.1.0-next.
|
|
6
|
+
"version": "2.1.0-next.30+e7dc751d",
|
|
7
7
|
"description": "Math toolbar for editing math equations",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"math",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@emotion/style": "^0.8.0",
|
|
22
22
|
"@mui/icons-material": "^7.3.4",
|
|
23
23
|
"@mui/material": "^7.3.4",
|
|
24
|
-
"@pie-lib/math-input": "7.1.0-next.
|
|
25
|
-
"@pie-lib/render-ui": "5.1.0-next.
|
|
24
|
+
"@pie-lib/math-input": "^7.1.0-next.4",
|
|
25
|
+
"@pie-lib/render-ui": "^5.1.0-next.5",
|
|
26
26
|
"debug": "^4.1.1",
|
|
27
27
|
"lodash": "^4.17.11",
|
|
28
28
|
"prop-types": "^15.7.2"
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"react-dom": "^18.2.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@pie-lib/test-utils": "1.1.0-next.
|
|
35
|
+
"@pie-lib/test-utils": "^1.1.0-next.4"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "e7dc751d1fffec5e3570e623fc4577a8ddd33519"
|
|
39
39
|
}
|
|
@@ -4,11 +4,7 @@ import MathPreview from '../math-preview';
|
|
|
4
4
|
|
|
5
5
|
describe('MathPreview', () => {
|
|
6
6
|
const defaultProps = {
|
|
7
|
-
|
|
8
|
-
data: {
|
|
9
|
-
get: jest.fn().mockReturnValue('sqrt(5)'),
|
|
10
|
-
},
|
|
11
|
-
},
|
|
7
|
+
latex: 'sqrt(5)',
|
|
12
8
|
classes: {},
|
|
13
9
|
isSelected: false,
|
|
14
10
|
onFocus: jest.fn(),
|
package/src/math-preview.jsx
CHANGED
|
@@ -130,7 +130,6 @@ const InsideOverlay = styled('span')({
|
|
|
130
130
|
export class RawMathPreview extends React.Component {
|
|
131
131
|
static propTypes = {
|
|
132
132
|
latex: PropTypes.string,
|
|
133
|
-
node: PropTypes.object,
|
|
134
133
|
isSelected: PropTypes.bool,
|
|
135
134
|
onFocus: PropTypes.func,
|
|
136
135
|
onBlur: PropTypes.func,
|
|
@@ -142,15 +141,14 @@ export class RawMathPreview extends React.Component {
|
|
|
142
141
|
|
|
143
142
|
componentDidUpdate(prevProps) {
|
|
144
143
|
// Re-run only if LaTeX changed
|
|
145
|
-
if (this.props.
|
|
144
|
+
if (this.props.latex !== prevProps.latex) {
|
|
146
145
|
markFractionBaseSuperscripts();
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
render() {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const { isSelected, onFocus, onBlur } = this.props;
|
|
150
|
+
const { isSelected, onFocus, onBlur, latex } = this.props;
|
|
151
|
+
log('[render] latex: ', latex);
|
|
154
152
|
return (
|
|
155
153
|
<MathPreviewContainer isSelected={isSelected}>
|
|
156
154
|
{' '}
|