@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.
Files changed (54) hide show
  1. package/README.md +47 -2
  2. package/dist/mdeditor.js +4114 -4095
  3. package/dist/mdeditor.min.js +1 -1
  4. package/esm/Context.d.ts +1 -1
  5. package/esm/Editor.d.ts +4 -149
  6. package/esm/Editor.js +0 -1
  7. package/esm/Editor.nohighlight.d.ts +12 -0
  8. package/esm/Editor.nohighlight.js +255 -0
  9. package/esm/Types.d.ts +148 -0
  10. package/esm/Types.js +1 -0
  11. package/esm/components/DragBar/index.d.ts +1 -1
  12. package/esm/components/TextArea/Markdown.d.ts +1 -1
  13. package/esm/components/TextArea/Textarea.d.ts +1 -1
  14. package/esm/components/TextArea/index.d.ts +1 -1
  15. package/esm/components/TextArea/index.nohighlight.d.ts +27 -0
  16. package/esm/components/TextArea/index.nohighlight.js +93 -0
  17. package/esm/components/Toolbar/Child.d.ts +1 -1
  18. package/esm/components/Toolbar/index.d.ts +1 -1
  19. package/esm/index.d.ts +2 -0
  20. package/esm/index.js +2 -0
  21. package/esm/index.nohighlight.d.ts +13 -0
  22. package/esm/index.nohighlight.js +13 -0
  23. package/lib/Context.d.ts +1 -1
  24. package/lib/Editor.d.ts +4 -149
  25. package/lib/Editor.nohighlight.d.ts +12 -0
  26. package/lib/Editor.nohighlight.js +317 -0
  27. package/lib/Types.d.ts +148 -0
  28. package/lib/Types.js +1 -0
  29. package/lib/components/DragBar/index.d.ts +1 -1
  30. package/lib/components/TextArea/Markdown.d.ts +1 -1
  31. package/lib/components/TextArea/Textarea.d.ts +1 -1
  32. package/lib/components/TextArea/index.d.ts +1 -1
  33. package/lib/components/TextArea/index.nohighlight.d.ts +27 -0
  34. package/lib/components/TextArea/index.nohighlight.js +98 -0
  35. package/lib/components/Toolbar/Child.d.ts +1 -1
  36. package/lib/components/Toolbar/index.d.ts +1 -1
  37. package/lib/index.d.ts +2 -0
  38. package/lib/index.js +12 -0
  39. package/lib/index.nohighlight.d.ts +13 -0
  40. package/lib/index.nohighlight.js +98 -0
  41. package/package.json +16 -2
  42. package/src/Context.tsx +1 -1
  43. package/src/Editor.nohighlight.tsx +264 -0
  44. package/src/Editor.tsx +5 -151
  45. package/src/Types.ts +151 -0
  46. package/src/components/DragBar/index.tsx +1 -1
  47. package/src/components/TextArea/Markdown.tsx +2 -2
  48. package/src/components/TextArea/Textarea.tsx +1 -1
  49. package/src/components/TextArea/index.nohighlight.tsx +109 -0
  50. package/src/components/TextArea/index.tsx +1 -1
  51. package/src/components/Toolbar/Child.tsx +1 -1
  52. package/src/components/Toolbar/index.tsx +1 -1
  53. package/src/index.nohighlight.tsx +16 -0
  54. 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
  [![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](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 watch # Listen create type and .tsx files.
818
- npm run start # Preview code example.
863
+ npm run start
819
864
  ```
820
865
 
821
866
  ### Related