react-mathtype-editor 1.0.0 → 1.0.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/README.md +2 -2
- package/dist/cjs/MathTypeEditor.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/esm/MathTypeEditor.js +2 -2
- package/dist/esm/index.js +3 -3
- package/dist/types/src/MathTypeEditor.d.ts +3 -3
- package/dist/types/src/MathTypeEditor.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ npm install react-mathtype-editor
|
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
import React, { useState } from 'react';
|
|
26
|
-
import
|
|
26
|
+
import MathTypeEditor from 'react-mathtype-editor';
|
|
27
27
|
import 'react-mathtype-editor/dist/style.css';
|
|
28
28
|
|
|
29
29
|
function App() {
|
|
@@ -31,7 +31,7 @@ function App() {
|
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<div>
|
|
34
|
-
<
|
|
34
|
+
<MathTypeEditor
|
|
35
35
|
defaultValue={formula}
|
|
36
36
|
onChange={(value) => setFormula(value)}
|
|
37
37
|
style={{ width: '100%' }}
|
|
@@ -11,7 +11,7 @@ const const_1 = require("./const");
|
|
|
11
11
|
require("mathlive");
|
|
12
12
|
require("katex/dist/katex.css");
|
|
13
13
|
require("../styles/mathType.less");
|
|
14
|
-
const
|
|
14
|
+
const MathTypeEditor = ({ defaultValue, onChange, style }) => {
|
|
15
15
|
const [activeKey, setActiveKey] = (0, react_1.useState)(const_1.KATEXLIST[0]?.name || '1');
|
|
16
16
|
const [editMode, setEditMode] = (0, react_1.useState)('mathlive');
|
|
17
17
|
const [latexVal, setLatexVal] = (0, react_1.useState)(defaultValue || '');
|
|
@@ -477,4 +477,4 @@ const MathEditor = ({ defaultValue, onChange, style }) => {
|
|
|
477
477
|
} }, `${i.name}-${idx}`))) })),
|
|
478
478
|
})) })] }));
|
|
479
479
|
};
|
|
480
|
-
exports.default =
|
|
480
|
+
exports.default = MathTypeEditor;
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.MathTypeEditor = void 0;
|
|
9
9
|
const MathTypeEditor_1 = __importDefault(require("./MathTypeEditor"));
|
|
10
|
-
exports.
|
|
10
|
+
exports.MathTypeEditor = MathTypeEditor_1.default;
|
|
11
11
|
exports.default = MathTypeEditor_1.default;
|
|
@@ -6,7 +6,7 @@ import { KATEXLIST } from './const';
|
|
|
6
6
|
import 'mathlive';
|
|
7
7
|
import 'katex/dist/katex.css';
|
|
8
8
|
import '../styles/mathType.less';
|
|
9
|
-
const
|
|
9
|
+
const MathTypeEditor = ({ defaultValue, onChange, style }) => {
|
|
10
10
|
const [activeKey, setActiveKey] = useState(KATEXLIST[0]?.name || '1');
|
|
11
11
|
const [editMode, setEditMode] = useState('mathlive');
|
|
12
12
|
const [latexVal, setLatexVal] = useState(defaultValue || '');
|
|
@@ -472,4 +472,4 @@ const MathEditor = ({ defaultValue, onChange, style }) => {
|
|
|
472
472
|
} }, `${i.name}-${idx}`))) })),
|
|
473
473
|
})) })] }));
|
|
474
474
|
};
|
|
475
|
-
export default
|
|
475
|
+
export default MathTypeEditor;
|
package/dist/esm/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import 'mathlive';
|
|
3
3
|
import 'katex/dist/katex.css';
|
|
4
4
|
import '../styles/mathType.less';
|
|
5
|
-
export interface
|
|
5
|
+
export interface MathTypeEditorProps {
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
onChange?: (value: string) => void;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
}
|
|
10
|
-
declare const
|
|
11
|
-
export default
|
|
10
|
+
declare const MathTypeEditor: React.FC<MathTypeEditorProps>;
|
|
11
|
+
export default MathTypeEditor;
|
|
12
12
|
//# sourceMappingURL=MathTypeEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MathTypeEditor.d.ts","sourceRoot":"","sources":["../../../src/MathTypeEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,UAAU,CAAA;AACjB,OAAO,sBAAsB,CAAA;AAC7B,OAAO,yBAAyB,CAAA;AAEhC,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"MathTypeEditor.d.ts","sourceRoot":"","sources":["../../../src/MathTypeEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,UAAU,CAAA;AACjB,OAAO,sBAAsB,CAAA;AAC7B,OAAO,yBAAyB,CAAA;AAEhC,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkkBjD,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
3
|
-
export default
|
|
4
|
-
export type {
|
|
1
|
+
import MathTypeEditor from './MathTypeEditor';
|
|
2
|
+
export { MathTypeEditor };
|
|
3
|
+
export default MathTypeEditor;
|
|
4
|
+
export type { MathTypeEditorProps } from './MathTypeEditor';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,eAAe,cAAc,CAAC;AAG9B,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/package.json
CHANGED