@uiw/react-md-editor 3.24.0 → 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 +50 -5
- package/dist/mdeditor.js +1835 -1807
- 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/commands/index.d.ts +4 -1
- package/esm/commands/index.js +2 -1
- 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/handleKeyDown.js +1 -3
- 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/commands/index.d.ts +4 -1
- package/lib/commands/index.js +19 -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/handleKeyDown.js +1 -3
- 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/commands/index.ts +4 -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/handleKeyDown.tsx +5 -3
- 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
|
+
|
|
816
846
|
```bash
|
|
817
|
-
npm
|
|
818
|
-
npm run
|
|
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
|
+
|
|
862
|
+
```bash
|
|
863
|
+
npm run start
|
|
819
864
|
```
|
|
820
865
|
|
|
821
866
|
### Related
|
|
@@ -846,6 +891,9 @@ As always, thanks to our amazing contributors!
|
|
|
846
891
|
<a href="https://github.com/alphacoma18" title="Alpha Romer Coma">
|
|
847
892
|
<img src="https://avatars.githubusercontent.com/u/108984668?v=4" width="42;" alt="Alpha Romer Coma"/>
|
|
848
893
|
</a>
|
|
894
|
+
<a href="https://github.com/RARgames" title="RAR">
|
|
895
|
+
<img src="https://avatars.githubusercontent.com/u/13639766?v=4" width="42;" alt="RAR"/>
|
|
896
|
+
</a>
|
|
849
897
|
<a href="https://github.com/Exmirai" title="UniqueUlysees">
|
|
850
898
|
<img src="https://avatars.githubusercontent.com/u/6436703?v=4" width="42;" alt="UniqueUlysees"/>
|
|
851
899
|
</a>
|
|
@@ -882,9 +930,6 @@ As always, thanks to our amazing contributors!
|
|
|
882
930
|
<a href="https://github.com/phillipb" title="Phillip Burch">
|
|
883
931
|
<img src="https://avatars.githubusercontent.com/u/1482089?v=4" width="42;" alt="Phillip Burch"/>
|
|
884
932
|
</a>
|
|
885
|
-
<a href="https://github.com/RARgames" title="RAR">
|
|
886
|
-
<img src="https://avatars.githubusercontent.com/u/13639766?v=4" width="42;" alt="RAR"/>
|
|
887
|
-
</a>
|
|
888
933
|
<a href="https://github.com/toresbe" title="Tore Sinding Bekkedal">
|
|
889
934
|
<img src="https://avatars.githubusercontent.com/u/1761606?v=4" width="42;" alt="Tore Sinding Bekkedal"/>
|
|
890
935
|
</a>
|