@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.
Files changed (62) hide show
  1. package/README.md +50 -5
  2. package/dist/mdeditor.js +1835 -1807
  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/commands/index.d.ts +4 -1
  12. package/esm/commands/index.js +2 -1
  13. package/esm/components/DragBar/index.d.ts +1 -1
  14. package/esm/components/TextArea/Markdown.d.ts +1 -1
  15. package/esm/components/TextArea/Textarea.d.ts +1 -1
  16. package/esm/components/TextArea/handleKeyDown.js +1 -3
  17. package/esm/components/TextArea/index.d.ts +1 -1
  18. package/esm/components/TextArea/index.nohighlight.d.ts +27 -0
  19. package/esm/components/TextArea/index.nohighlight.js +93 -0
  20. package/esm/components/Toolbar/Child.d.ts +1 -1
  21. package/esm/components/Toolbar/index.d.ts +1 -1
  22. package/esm/index.d.ts +2 -0
  23. package/esm/index.js +2 -0
  24. package/esm/index.nohighlight.d.ts +13 -0
  25. package/esm/index.nohighlight.js +13 -0
  26. package/lib/Context.d.ts +1 -1
  27. package/lib/Editor.d.ts +4 -149
  28. package/lib/Editor.nohighlight.d.ts +12 -0
  29. package/lib/Editor.nohighlight.js +317 -0
  30. package/lib/Types.d.ts +148 -0
  31. package/lib/Types.js +1 -0
  32. package/lib/commands/index.d.ts +4 -1
  33. package/lib/commands/index.js +19 -0
  34. package/lib/components/DragBar/index.d.ts +1 -1
  35. package/lib/components/TextArea/Markdown.d.ts +1 -1
  36. package/lib/components/TextArea/Textarea.d.ts +1 -1
  37. package/lib/components/TextArea/handleKeyDown.js +1 -3
  38. package/lib/components/TextArea/index.d.ts +1 -1
  39. package/lib/components/TextArea/index.nohighlight.d.ts +27 -0
  40. package/lib/components/TextArea/index.nohighlight.js +98 -0
  41. package/lib/components/Toolbar/Child.d.ts +1 -1
  42. package/lib/components/Toolbar/index.d.ts +1 -1
  43. package/lib/index.d.ts +2 -0
  44. package/lib/index.js +12 -0
  45. package/lib/index.nohighlight.d.ts +13 -0
  46. package/lib/index.nohighlight.js +98 -0
  47. package/package.json +16 -2
  48. package/src/Context.tsx +1 -1
  49. package/src/Editor.nohighlight.tsx +264 -0
  50. package/src/Editor.tsx +5 -151
  51. package/src/Types.ts +151 -0
  52. package/src/commands/index.ts +4 -0
  53. package/src/components/DragBar/index.tsx +1 -1
  54. package/src/components/TextArea/Markdown.tsx +2 -2
  55. package/src/components/TextArea/Textarea.tsx +1 -1
  56. package/src/components/TextArea/handleKeyDown.tsx +5 -3
  57. package/src/components/TextArea/index.nohighlight.tsx +109 -0
  58. package/src/components/TextArea/index.tsx +1 -1
  59. package/src/components/Toolbar/Child.tsx +1 -1
  60. package/src/components/Toolbar/index.tsx +1 -1
  61. package/src/index.nohighlight.tsx +16 -0
  62. 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
+
816
846
  ```bash
817
- npm run watch # Listen create type and .tsx files.
818
- npm run start # Preview code example.
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>