@uiw/react-md-editor 3.24.1 → 3.25.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/README.md +47 -2
- package/dist/mdeditor.js +4114 -4095
- package/dist/mdeditor.min.js +1 -1
- package/esm/Context.d.ts +1 -1
- package/esm/Editor.d.ts +4 -149
- package/esm/Editor.js +0 -1
- package/esm/Editor.nohighlight.d.ts +12 -0
- package/esm/Editor.nohighlight.js +255 -0
- package/esm/Types.d.ts +148 -0
- package/esm/Types.js +1 -0
- package/esm/components/DragBar/index.d.ts +1 -1
- package/esm/components/TextArea/Markdown.d.ts +1 -1
- package/esm/components/TextArea/Textarea.d.ts +1 -1
- package/esm/components/TextArea/index.d.ts +1 -1
- package/esm/components/TextArea/index.nohighlight.d.ts +27 -0
- package/esm/components/TextArea/index.nohighlight.js +93 -0
- package/esm/components/Toolbar/Child.d.ts +1 -1
- package/esm/components/Toolbar/index.d.ts +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/index.nohighlight.d.ts +13 -0
- package/esm/index.nohighlight.js +13 -0
- package/lib/Context.d.ts +1 -1
- package/lib/Editor.d.ts +4 -149
- package/lib/Editor.nohighlight.d.ts +12 -0
- package/lib/Editor.nohighlight.js +317 -0
- package/lib/Types.d.ts +148 -0
- package/lib/Types.js +1 -0
- package/lib/components/DragBar/index.d.ts +1 -1
- package/lib/components/TextArea/Markdown.d.ts +1 -1
- package/lib/components/TextArea/Textarea.d.ts +1 -1
- package/lib/components/TextArea/index.d.ts +1 -1
- package/lib/components/TextArea/index.nohighlight.d.ts +27 -0
- package/lib/components/TextArea/index.nohighlight.js +98 -0
- package/lib/components/Toolbar/Child.d.ts +1 -1
- package/lib/components/Toolbar/index.d.ts +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +12 -0
- package/lib/index.nohighlight.d.ts +13 -0
- package/lib/index.nohighlight.js +98 -0
- package/package.json +16 -2
- package/src/Context.tsx +1 -1
- package/src/Editor.nohighlight.tsx +264 -0
- package/src/Editor.tsx +5 -151
- package/src/Types.ts +151 -0
- package/src/components/DragBar/index.tsx +1 -1
- package/src/components/TextArea/Markdown.tsx +2 -2
- package/src/components/TextArea/Textarea.tsx +1 -1
- package/src/components/TextArea/index.nohighlight.tsx +109 -0
- package/src/components/TextArea/index.tsx +1 -1
- package/src/components/Toolbar/Child.tsx +1 -1
- package/src/components/Toolbar/index.tsx +1 -1
- package/src/index.nohighlight.tsx +16 -0
- package/src/index.tsx +2 -0
package/README.md
CHANGED
|
@@ -137,6 +137,34 @@ export default function App() {
|
|
|
137
137
|
}
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
### Remove Code Highlight
|
|
141
|
+
|
|
142
|
+
The following example can help you _exclude code highlighting code_<!--rehype:style=color: #333;background-color: rgb(196 255 122 / 86%);--> from being included in the bundle. `@uiw/react-md-editor/nohighlight`<!--rehype:style=color: #e24444;--> component does not contain the ~~`rehype-prism-plus`~~ code highlighting package, ~~`highlightEnable`~~, ~~`showLineNumbers`~~ and ~~`highlight line`~~ functions will no longer work. ([#586](https://github.com/uiwjs/react-md-editor/issues/586))
|
|
143
|
+
|
|
144
|
+
```jsx mdx:preview
|
|
145
|
+
import React from "react";
|
|
146
|
+
import MDEditor from '@uiw/react-md-editor/nohighlight';
|
|
147
|
+
|
|
148
|
+
const code = `**Hello world!!!**
|
|
149
|
+
\`\`\`js
|
|
150
|
+
function demo() {}
|
|
151
|
+
\`\`\`
|
|
152
|
+
`
|
|
153
|
+
|
|
154
|
+
export default function App() {
|
|
155
|
+
const [value, setValue] = React.useState(code);
|
|
156
|
+
return (
|
|
157
|
+
<div className="container">
|
|
158
|
+
<MDEditor
|
|
159
|
+
value={value}
|
|
160
|
+
onChange={setValue}
|
|
161
|
+
/>
|
|
162
|
+
<MDEditor.Markdown source={value} style={{ whiteSpace: 'pre-wrap' }} />
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
140
168
|
### Custom Toolbars
|
|
141
169
|
|
|
142
170
|
[](https://codesandbox.io/embed/react-md-editor-custom-toolbars-m2n10?fontsize=14&hidenavigation=1&theme=dark)
|
|
@@ -813,9 +841,26 @@ Inherit custom color variables by adding [`.wmde-markdown-var`](https://github.c
|
|
|
813
841
|
|
|
814
842
|
### Development
|
|
815
843
|
|
|
844
|
+
1. Install dependencies
|
|
845
|
+
|
|
846
|
+
```bash
|
|
847
|
+
$ npm install # Installation dependencies
|
|
848
|
+
$ npm run build # Compile all package
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
2. Development `@uiw/react-md-editor` package:
|
|
852
|
+
|
|
853
|
+
```bash
|
|
854
|
+
$ cd core
|
|
855
|
+
# listen to the component compile and output the .js file
|
|
856
|
+
# listen for compilation output type .d.ts file
|
|
857
|
+
$ npm run watch # Monitor the compiled package `@uiw/react-md-editor`
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
3. Launch documentation site
|
|
861
|
+
|
|
816
862
|
```bash
|
|
817
|
-
npm run
|
|
818
|
-
npm run start # Preview code example.
|
|
863
|
+
npm run start
|
|
819
864
|
```
|
|
820
865
|
|
|
821
866
|
### Related
|