lexical-medium-editor 1.2.7 → 1.2.8
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 +43 -0
- package/dist-lib/index.es.js +517 -449
- package/dist-lib/index.es.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,3 +63,46 @@ export default function App() {
|
|
|
63
63
|
|
|
64
64
|
> [!TIP]
|
|
65
65
|
> You can also copy the CSS from `node_modules/lexical-medium-editor/dist-lib/lexical-medium-editor.css` into your own project and modify it to customize the editor's appearance.
|
|
66
|
+
|
|
67
|
+
## Props
|
|
68
|
+
|
|
69
|
+
| Prop | Description |
|
|
70
|
+
| :--- | :--- |
|
|
71
|
+
| `initialConfig` | Contains information about namespace, theme, error handling and nodes. |
|
|
72
|
+
| `onChange` | Can be used to handle actions when the editor state changes. |
|
|
73
|
+
| `editorRef` | A ref to the editor. |
|
|
74
|
+
| `blockToolbarGap` | The gap between the block toolbar and the start of the editor. |
|
|
75
|
+
| `isHeadingOneFirst` | If `true`, the first heading is automatically triggered to a title heading. |
|
|
76
|
+
| `spellCheck` | If `false`, disables spellcheck. |
|
|
77
|
+
|
|
78
|
+
## Enable Math Capabilities
|
|
79
|
+
|
|
80
|
+
To enable math capabilities, you need to add MathJax 4 to your project. Here is an example of how to configure it in your `index.html`:
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<script>
|
|
84
|
+
window.MathJax = {
|
|
85
|
+
tex: {
|
|
86
|
+
inlineMath: [
|
|
87
|
+
["$", "$"],
|
|
88
|
+
["\\(", "\\)"],
|
|
89
|
+
],
|
|
90
|
+
displayMath: [
|
|
91
|
+
["$$", "$$"],
|
|
92
|
+
["\\[", "\\]"],
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
chtml: {
|
|
96
|
+
displayOverflow: "scroll",
|
|
97
|
+
linebreaks: {
|
|
98
|
+
inline: true,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
startup: {
|
|
102
|
+
typeset: false,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
</script>
|
|
106
|
+
<script type="text/javascript" id="MathJax-script" async
|
|
107
|
+
src="https://cdn.jsdelivr.net/npm/mathjax@4.0.0-beta.4/tex-mml-chtml.js"></script>
|
|
108
|
+
```
|