@uiw/react-md-editor 3.17.0 → 3.18.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 +19 -1
- package/dist/mdeditor.css +22 -6
- package/dist/mdeditor.js +944 -698
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/esm/Context.d.ts +1 -0
- package/esm/Editor.d.ts +5 -0
- package/esm/Editor.js +21 -13
- package/esm/Editor.js.map +4 -4
- package/esm/components/DragBar/index.css +1 -0
- package/esm/components/DragBar/index.less +1 -0
- package/esm/components/Toolbar/Child.js +0 -1
- package/esm/components/Toolbar/Child.js.map +2 -2
- package/esm/components/Toolbar/index.css +6 -1
- package/esm/components/Toolbar/index.d.ts +0 -2
- package/esm/components/Toolbar/index.js +0 -4
- package/esm/components/Toolbar/index.js.map +2 -3
- package/esm/components/Toolbar/index.less +6 -1
- package/esm/index.css +10 -3
- package/esm/index.less +9 -3
- package/lib/Context.d.ts +1 -0
- package/lib/Editor.d.ts +5 -0
- package/lib/Editor.js +24 -15
- package/lib/Editor.js.map +5 -5
- package/lib/components/DragBar/index.less +1 -0
- package/lib/components/Toolbar/Child.js +0 -1
- package/lib/components/Toolbar/Child.js.map +2 -2
- package/lib/components/Toolbar/index.d.ts +0 -2
- package/lib/components/Toolbar/index.js +0 -5
- package/lib/components/Toolbar/index.js.map +2 -3
- package/lib/components/Toolbar/index.less +6 -1
- package/lib/index.less +9 -3
- package/markdown-editor.css +17 -4
- package/package.json +2 -2
- package/src/Editor.tsx +30 -21
- package/src/components/DragBar/index.less +1 -0
- package/src/components/Toolbar/Child.tsx +1 -1
- package/src/components/Toolbar/index.less +6 -1
- package/src/components/Toolbar/index.tsx +2 -3
- package/src/index.less +9 -3
package/README.md
CHANGED
|
@@ -329,6 +329,19 @@ export default function App() {
|
|
|
329
329
|
}
|
|
330
330
|
```
|
|
331
331
|
|
|
332
|
+
### Editor Font Size
|
|
333
|
+
|
|
334
|
+
[](https://codesandbox.io/embed/markdown-editor-for-react-uiwjs-react-md-editor-issues-425-2epmgh?fontsize=14&hidenavigation=1&theme=dark)
|
|
335
|
+
[](https://github.com/uiwjs/react-md-editor/issues/425#issuecomment-1209514536)
|
|
336
|
+
|
|
337
|
+
```css
|
|
338
|
+
.w-md-editor-text-pre > code,
|
|
339
|
+
.w-md-editor-text-input {
|
|
340
|
+
font-size: 23px !important;
|
|
341
|
+
line-height: 24px !important;
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
332
345
|
### Preview Markdown
|
|
333
346
|
|
|
334
347
|
[](https://codesandbox.io/embed/react-md-editor-preview-markdown-vrucl?fontsize=14&hidenavigation=1&theme=dark)
|
|
@@ -566,9 +579,11 @@ ReactDOM.render(<App />, document.getElementById("container"));
|
|
|
566
579
|
|
|
567
580
|
### Support Nextjs
|
|
568
581
|
|
|
569
|
-
Use examples in [nextjs](https://nextjs.org/). [
|
|
582
|
+
Use examples in [nextjs](https://nextjs.org/). [`#52`](https://github.com/uiwjs/react-md-editor/issues/52#issuecomment-848969341) [`#224`](https://github.com/uiwjs/react-md-editor/issues/224#issuecomment-901112079)
|
|
570
583
|
|
|
571
584
|
[](https://codesandbox.io/embed/nextjs-example-react-md-editor-qjhn7?fontsize=14&hidenavigation=1&theme=dark) [](https://stackblitz.com/edit/nextjs-react-md-editor?embed=1&file=pages/index.js&hideExplorer=1&hideNavigation=1&theme=dark)
|
|
585
|
+
[](https://github.com/uiwjs/react-md-editor/issues/52#issuecomment-848969341)
|
|
586
|
+
[](https://github.com/uiwjs/react-md-editor/issues/224#issuecomment-901112079)
|
|
572
587
|
|
|
573
588
|
```bash
|
|
574
589
|
npm install next-remove-imports
|
|
@@ -639,6 +654,9 @@ Inherit custom color variables by adding [`.wmde-markdown-var`](https://github.c
|
|
|
639
654
|
- `textareaProps?: TextareaHTMLAttributes`: Set the `textarea` related props.
|
|
640
655
|
- ~~`renderTextarea?: (props, opts) => JSX.Element;`~~: `@deprecated` Please use ~~`renderTextarea`~~ -> `components`. Use div to replace TextArea or re-render TextArea. [#193](https://github.com/uiwjs/react-md-editor/issues/193)
|
|
641
656
|
- `components`: re-render textarea/toolbar element. [#419](https://github.com/uiwjs/react-md-editor/issues/419)
|
|
657
|
+
- `textarea` Use div to replace TextArea or re-render TextArea
|
|
658
|
+
- `toolbar` Override the default command element. _`toolbar`_ < _`command[].render`_
|
|
659
|
+
- `preview` Custom markdown preview. [#429](https://github.com/uiwjs/react-md-editor/issues/429)
|
|
642
660
|
- `height?: number=200`: The height of the editor. ️⚠️ `Dragbar` is invalid when **`height`** parameter percentage.
|
|
643
661
|
- `visibleDragbar?: boolean=true`: Show drag and drop tool. Set the height of the editor.
|
|
644
662
|
- `highlightEnable?: boolean=true`: Disable editing area code highlighting. The value is `false`, which increases the editing speed.
|
package/dist/mdeditor.css
CHANGED
|
@@ -278,12 +278,12 @@ body[data-color-mode*='light'] {
|
|
|
278
278
|
box-sizing: content-box;
|
|
279
279
|
overflow: hidden;
|
|
280
280
|
background: transparent;
|
|
281
|
+
border: 0;
|
|
281
282
|
border-bottom: 1px solid var(--color-border-muted);
|
|
282
283
|
height: 0.25em;
|
|
283
284
|
padding: 0;
|
|
284
285
|
margin: 24px 0;
|
|
285
286
|
background-color: var(--color-border-default);
|
|
286
|
-
border: 0;
|
|
287
287
|
}
|
|
288
288
|
.wmde-markdown input {
|
|
289
289
|
font: inherit;
|
|
@@ -866,7 +866,8 @@ body[data-color-mode*='light'] {
|
|
|
866
866
|
.wmde-markdown .task-list-item .handle {
|
|
867
867
|
display: none;
|
|
868
868
|
}
|
|
869
|
-
.wmde-markdown .task-list-item-checkbox
|
|
869
|
+
.wmde-markdown .task-list-item-checkbox,
|
|
870
|
+
.wmde-markdown .contains-task-list input[type='checkbox'] {
|
|
870
871
|
margin: 0 0.2em 0.25em -1.6em;
|
|
871
872
|
vertical-align: middle;
|
|
872
873
|
}
|
|
@@ -1166,7 +1167,7 @@ body[data-color-mode*='light'] {
|
|
|
1166
1167
|
.w-md-editor-toolbar {
|
|
1167
1168
|
border-bottom: 1px solid var(--color-border-default);
|
|
1168
1169
|
background-color: var(--color-canvas-default);
|
|
1169
|
-
padding:
|
|
1170
|
+
padding: 5px 5px;
|
|
1170
1171
|
display: flex;
|
|
1171
1172
|
justify-content: space-between;
|
|
1172
1173
|
align-items: center;
|
|
@@ -1174,6 +1175,7 @@ body[data-color-mode*='light'] {
|
|
|
1174
1175
|
-webkit-user-select: none;
|
|
1175
1176
|
-moz-user-select: none;
|
|
1176
1177
|
user-select: none;
|
|
1178
|
+
flex-wrap: wrap;
|
|
1177
1179
|
}
|
|
1178
1180
|
.w-md-editor-toolbar.bottom {
|
|
1179
1181
|
border-bottom: 0px;
|
|
@@ -1185,11 +1187,16 @@ body[data-color-mode*='light'] {
|
|
|
1185
1187
|
margin: 0;
|
|
1186
1188
|
padding: 0;
|
|
1187
1189
|
list-style: none;
|
|
1190
|
+
line-height: normal;
|
|
1191
|
+
line-height: initial;
|
|
1188
1192
|
}
|
|
1189
1193
|
.w-md-editor-toolbar li {
|
|
1190
1194
|
display: inline-block;
|
|
1191
1195
|
font-size: 14px;
|
|
1192
1196
|
}
|
|
1197
|
+
.w-md-editor-toolbar li + li {
|
|
1198
|
+
margin: 0;
|
|
1199
|
+
}
|
|
1193
1200
|
.w-md-editor-toolbar li > button {
|
|
1194
1201
|
border: none;
|
|
1195
1202
|
height: 20px;
|
|
@@ -1240,6 +1247,7 @@ body[data-color-mode*='light'] {
|
|
|
1240
1247
|
position: absolute;
|
|
1241
1248
|
cursor: s-resize;
|
|
1242
1249
|
right: 0;
|
|
1250
|
+
bottom: 0;
|
|
1243
1251
|
margin-top: -11px;
|
|
1244
1252
|
margin-right: 0;
|
|
1245
1253
|
width: 14px;
|
|
@@ -1264,14 +1272,22 @@ body[data-color-mode*='light'] {
|
|
|
1264
1272
|
box-shadow: 0 0 0 1px var(--color-border-default), 0 0 0 var(--color-border-default), 0 1px 1px var(--color-border-default);
|
|
1265
1273
|
background-color: var(--color-canvas-default);
|
|
1266
1274
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
1275
|
+
display: flex;
|
|
1276
|
+
flex-direction: column;
|
|
1267
1277
|
}
|
|
1268
|
-
.w-md-editor
|
|
1269
|
-
|
|
1278
|
+
.w-md-editor-toolbar {
|
|
1279
|
+
height: -webkit-fit-content;
|
|
1280
|
+
height: -moz-fit-content;
|
|
1281
|
+
height: fit-content;
|
|
1270
1282
|
}
|
|
1271
1283
|
.w-md-editor-content {
|
|
1284
|
+
height: 100%;
|
|
1285
|
+
overflow: auto;
|
|
1272
1286
|
position: relative;
|
|
1273
1287
|
border-radius: 0 0 3px 0;
|
|
1274
|
-
|
|
1288
|
+
}
|
|
1289
|
+
.w-md-editor .copied {
|
|
1290
|
+
display: none !important;
|
|
1275
1291
|
}
|
|
1276
1292
|
.w-md-editor-input {
|
|
1277
1293
|
width: 50%;
|