@uiw/react-md-editor 4.1.5 → 4.1.7
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 +16 -1
- package/dist/mdeditor.css +5 -0
- package/dist/mdeditor.js +2382 -1031
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/esm/Editor.factory.js +85 -11
- package/esm/Types.d.ts +6 -0
- package/esm/commands/index.cn.d.ts +2 -1
- package/esm/commands/index.cn.js +2 -2
- package/esm/commands/index.d.ts +2 -2
- package/esm/commands/index.js +2 -2
- package/esm/commands/list.d.ts +1 -1
- package/esm/commands/list.js +9 -3
- package/esm/components/TextArea/Markdown.common.d.ts +3 -5
- package/esm/components/TextArea/Markdown.common.js +2 -56
- package/esm/components/TextArea/Markdown.d.ts +3 -5
- package/esm/components/TextArea/Markdown.factory.d.ts +6 -0
- package/esm/components/TextArea/Markdown.factory.js +138 -0
- package/esm/components/TextArea/Markdown.js +2 -63
- package/esm/components/TextArea/factory.js +6 -2
- package/esm/components/TextArea/index.css +5 -0
- package/esm/components/TextArea/index.less +5 -0
- package/esm/components/TextArea/splitBlocks.d.ts +13 -0
- package/esm/components/TextArea/splitBlocks.js +111 -0
- package/esm/package.json +1 -0
- package/lib/Editor.factory.js +93 -12
- package/lib/Types.d.ts +6 -0
- package/lib/commands/index.cn.d.ts +2 -1
- package/lib/commands/index.cn.js +8 -1
- package/lib/commands/index.d.ts +2 -2
- package/lib/commands/index.js +6 -0
- package/lib/commands/list.d.ts +1 -1
- package/lib/commands/list.js +5 -1
- package/lib/components/TextArea/Markdown.common.d.ts +3 -5
- package/lib/components/TextArea/Markdown.common.js +3 -60
- package/lib/components/TextArea/Markdown.d.ts +3 -5
- package/lib/components/TextArea/Markdown.factory.d.ts +6 -0
- package/lib/components/TextArea/Markdown.factory.js +148 -0
- package/lib/components/TextArea/Markdown.js +3 -67
- package/lib/components/TextArea/factory.js +6 -2
- package/lib/components/TextArea/index.less +5 -0
- package/lib/components/TextArea/splitBlocks.d.ts +13 -0
- package/lib/components/TextArea/splitBlocks.js +117 -0
- package/markdown-editor.css +5 -0
- package/package.json +18 -12
- package/src/Editor.factory.tsx +83 -4
- package/src/Types.ts +6 -0
- package/src/commands/index.cn.ts +2 -0
- package/src/commands/index.ts +2 -1
- package/src/commands/list.tsx +11 -2
- package/src/components/TextArea/Markdown.common.tsx +3 -46
- package/src/components/TextArea/Markdown.factory.tsx +132 -0
- package/src/components/TextArea/Markdown.tsx +3 -55
- package/src/components/TextArea/factory.tsx +7 -4
- package/src/components/TextArea/index.less +5 -0
- package/src/components/TextArea/splitBlocks.ts +114 -0
package/README.md
CHANGED
|
@@ -330,6 +330,21 @@ export default function App() {
|
|
|
330
330
|
|
|
331
331
|
### Custom Toolbars
|
|
332
332
|
|
|
333
|
+
List commands select a word by default. Custom commands can pass 'line' to makeList to select the entire line instead
|
|
334
|
+
|
|
335
|
+
```tsx
|
|
336
|
+
import MDEditor, { commands } from '@uiw/react-md-editor';
|
|
337
|
+
|
|
338
|
+
const lineListCommand = {
|
|
339
|
+
...commands.unorderedListCommand,
|
|
340
|
+
execute: (state, api) => commands.makeList(state, api, '- ', 'line'),
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
// <MDEditor commands={[lineListCommand]} />
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
|
|
333
348
|
[](https://codesandbox.io/embed/react-md-editor-custom-toolbars-m2n10?fontsize=14&hidenavigation=1&theme=dark)
|
|
334
349
|
|
|
335
350
|
```jsx mdx:preview
|
|
@@ -1185,13 +1200,13 @@ As always, thanks to our amazing contributors!
|
|
|
1185
1200
|
<!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-->
|
|
1186
1201
|
<a href="https://github.com/jaywcjlove" title="小弟调调"><img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/></a>
|
|
1187
1202
|
<a href="https://github.com/renovate-bot" title="Mend Renovate"><img src="https://avatars.githubusercontent.com/u/25180681?v=4" width="42;" alt="Mend Renovate"/></a>
|
|
1203
|
+
<a href="https://github.com/hiyouwhatsapp" title="hiyouwhatsapp"><img src="https://avatars.githubusercontent.com/u/89997383?v=4" width="42;" alt="hiyouwhatsapp"/></a>
|
|
1188
1204
|
<a href="https://github.com/stevemk14ebr" title="Stephen Eckels"><img src="https://avatars.githubusercontent.com/u/6619205?v=4" width="42;" alt="Stephen Eckels"/></a>
|
|
1189
1205
|
<a href="https://github.com/RARgames" title="RAR"><img src="https://avatars.githubusercontent.com/u/13639766?v=4" width="42;" alt="RAR"/></a>
|
|
1190
1206
|
<a href="https://github.com/Stopa" title="Stepan Bolotnikov"><img src="https://avatars.githubusercontent.com/u/408256?v=4" width="42;" alt="Stepan Bolotnikov"/></a>
|
|
1191
1207
|
<a href="https://github.com/alpharomercoma" title="Alpha Romer Coma"><img src="https://avatars.githubusercontent.com/u/108984668?v=4" width="42;" alt="Alpha Romer Coma"/></a>
|
|
1192
1208
|
<a href="https://github.com/Exmirai" title="UniqueUlysees"><img src="https://avatars.githubusercontent.com/u/6436703?v=4" width="42;" alt="UniqueUlysees"/></a>
|
|
1193
1209
|
<a href="https://github.com/BetterAndBetterII" title="Yuzhong Zhang"><img src="https://avatars.githubusercontent.com/u/141388234?v=4" width="42;" alt="Yuzhong Zhang"/></a>
|
|
1194
|
-
<a href="https://github.com/hiyouwhatsapp" title="hiyouwhatsapp"><img src="https://avatars.githubusercontent.com/u/89997383?v=4" width="42;" alt="hiyouwhatsapp"/></a>
|
|
1195
1210
|
<a href="https://github.com/sandiiarov" title="Alex Sandiiarov"><img src="https://avatars.githubusercontent.com/u/15861257?v=4" width="42;" alt="Alex Sandiiarov"/></a>
|
|
1196
1211
|
<a href="https://github.com/nuragic" title="Andrea Puddu"><img src="https://avatars.githubusercontent.com/u/1586378?v=4" width="42;" alt="Andrea Puddu"/></a>
|
|
1197
1212
|
<a href="https://github.com/AntonR31337" title="Anton"><img src="https://avatars.githubusercontent.com/u/88384647?v=4" width="42;" alt="Anton"/></a>
|
package/dist/mdeditor.css
CHANGED
|
@@ -1226,6 +1226,11 @@ body[data-color-mode*='light'] {
|
|
|
1226
1226
|
.w-md-editor-text-pre .token.bold {
|
|
1227
1227
|
font-weight: inherit !important;
|
|
1228
1228
|
}
|
|
1229
|
+
.w-md-editor-text-pre .token.list,
|
|
1230
|
+
.w-md-editor-text-pre .token.table {
|
|
1231
|
+
display: inline;
|
|
1232
|
+
font-size: inherit;
|
|
1233
|
+
}
|
|
1229
1234
|
.w-md-editor-text-pre .token.title {
|
|
1230
1235
|
line-height: inherit !important;
|
|
1231
1236
|
font-size: inherit !important;
|