@uiw/react-md-editor 3.11.3 → 3.12.2
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 +2 -1
- package/dist/mdeditor.css +10 -15
- package/dist/mdeditor.js +1342 -165
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/esm/Context.js.map +5 -5
- package/esm/Editor.d.ts +5 -1
- package/esm/Editor.js +9 -7
- package/esm/Editor.js.map +7 -6
- package/esm/commands/bold.js.map +5 -5
- package/esm/commands/code.js +4 -2
- package/esm/commands/code.js.map +7 -6
- package/esm/commands/comment.js.map +5 -5
- package/esm/commands/divider.js.map +5 -5
- package/esm/commands/fullscreen.js.map +5 -5
- package/esm/commands/group.js.map +5 -5
- package/esm/commands/hr.js.map +5 -5
- package/esm/commands/image.js.map +5 -5
- package/esm/commands/index.js.map +5 -5
- package/esm/commands/italic.js.map +5 -5
- package/esm/commands/link.js.map +5 -5
- package/esm/commands/list.js.map +5 -5
- package/esm/commands/preview.js.map +5 -5
- package/esm/commands/quote.js.map +5 -5
- package/esm/commands/strikeThrough.js.map +5 -5
- package/esm/commands/title.js.map +5 -5
- package/esm/commands/title1.js.map +5 -5
- package/esm/commands/title2.js.map +5 -5
- package/esm/commands/title3.js.map +5 -5
- package/esm/commands/title4.js.map +5 -5
- package/esm/commands/title5.js.map +5 -5
- package/esm/commands/title6.js.map +5 -5
- package/esm/components/DragBar/index.js.map +5 -5
- package/esm/components/TextArea/Markdown.js.map +5 -5
- package/esm/components/TextArea/Textarea.js.map +5 -5
- package/esm/components/TextArea/handleKeyDown.js.map +5 -5
- package/esm/components/TextArea/index.js.map +5 -5
- package/esm/components/TextArea/shortcuts.js.map +5 -5
- package/esm/components/Toolbar/Child.js.map +5 -5
- package/esm/components/Toolbar/index.js.map +5 -5
- package/esm/index.js.map +5 -5
- package/esm/utils/InsertTextAtPosition.js.map +5 -5
- package/esm/utils/markdownUtils.js.map +5 -5
- package/lib/Context.js.map +5 -5
- package/lib/Editor.d.ts +5 -1
- package/lib/Editor.js +13 -9
- package/lib/Editor.js.map +7 -6
- package/lib/commands/bold.js.map +5 -5
- package/lib/commands/code.js +4 -2
- package/lib/commands/code.js.map +7 -6
- package/lib/commands/comment.js.map +5 -5
- package/lib/commands/divider.js.map +5 -5
- package/lib/commands/fullscreen.js.map +5 -5
- package/lib/commands/group.js.map +5 -5
- package/lib/commands/hr.js.map +5 -5
- package/lib/commands/image.js.map +5 -5
- package/lib/commands/index.js.map +5 -5
- package/lib/commands/italic.js.map +5 -5
- package/lib/commands/link.js.map +5 -5
- package/lib/commands/list.js.map +5 -5
- package/lib/commands/preview.js.map +5 -5
- package/lib/commands/quote.js.map +5 -5
- package/lib/commands/strikeThrough.js.map +5 -5
- package/lib/commands/title.js.map +5 -5
- package/lib/commands/title1.js.map +5 -5
- package/lib/commands/title2.js.map +5 -5
- package/lib/commands/title3.js.map +5 -5
- package/lib/commands/title4.js.map +5 -5
- package/lib/commands/title5.js.map +5 -5
- package/lib/commands/title6.js.map +5 -5
- package/lib/components/DragBar/index.js.map +5 -5
- package/lib/components/TextArea/Markdown.js.map +5 -5
- package/lib/components/TextArea/Textarea.js.map +5 -5
- package/lib/components/TextArea/handleKeyDown.js.map +5 -5
- package/lib/components/TextArea/index.js.map +5 -5
- package/lib/components/TextArea/shortcuts.js.map +5 -5
- package/lib/components/Toolbar/Child.js.map +5 -5
- package/lib/components/Toolbar/index.js.map +5 -5
- package/lib/index.js.map +5 -5
- package/lib/utils/InsertTextAtPosition.js.map +5 -5
- package/lib/utils/markdownUtils.js.map +5 -5
- package/package.json +1 -1
- package/src/Editor.tsx +13 -4
- package/src/__test__/editor.test.tsx +28 -3
- package/src/commands/code.tsx +2 -2
package/README.md
CHANGED
|
@@ -478,7 +478,8 @@ Inherit custom color variables by adding [`.wmde-markdown-var`](https://github.c
|
|
|
478
478
|
### Props
|
|
479
479
|
|
|
480
480
|
- `value: string`: The Markdown value.
|
|
481
|
-
- `onChange?: (value
|
|
481
|
+
- `onChange?: (value?: string, event?: React.ChangeEvent<HTMLTextAreaElement>, state?: ContextStore)`: Event handler for the `onChange` event.
|
|
482
|
+
- `onHeightChange?: (value?: number, oldValue?: number, state?: ContextStore)`: editor height change listener.
|
|
482
483
|
- `commands?: ICommand[]`: An array of [`ICommand`](https://github.com/uiwjs/react-md-editor/blob/d02543050c9abd8f7c72ae02b6421ac2e6ae421a/src/commands/index.ts#L39-L57), which, each one, contain a [`commands`](https://github.com/uiwjs/react-md-editor/blob/d02543050c9abd8f7c72ae02b6421ac2e6ae421a/src/commands/index.ts#L155-L180) property. If no commands are specified, the default will be used. Commands are explained in more details below.
|
|
483
484
|
- `commandsFilter?: (command: ICommand, isExtra: boolean) => false | ICommand`: Filter or modify your commands.
|
|
484
485
|
- `extraCommands?: ICommand[]`: Displayed on the right side of the toolbar.
|
package/dist/mdeditor.css
CHANGED
|
@@ -190,7 +190,7 @@ body[data-color-mode*='light'] {
|
|
|
190
190
|
}
|
|
191
191
|
.wmde-markdown {
|
|
192
192
|
-webkit-text-size-adjust: 100%;
|
|
193
|
-
font-family: -apple-system,
|
|
193
|
+
font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
194
194
|
font-size: 16px;
|
|
195
195
|
line-height: 1.5;
|
|
196
196
|
word-wrap: break-word;
|
|
@@ -789,17 +789,7 @@ body[data-color-mode*='light'] {
|
|
|
789
789
|
background: transparent;
|
|
790
790
|
border: 0;
|
|
791
791
|
}
|
|
792
|
-
.wmde-markdown .highlight {
|
|
793
|
-
margin-bottom: 16px;
|
|
794
|
-
}
|
|
795
|
-
.wmde-markdown .highlight pre {
|
|
796
|
-
margin-bottom: 0;
|
|
797
|
-
word-break: normal;
|
|
798
|
-
}
|
|
799
|
-
.wmde-markdown .highlight pre,
|
|
800
792
|
.wmde-markdown pre {
|
|
801
|
-
padding: 16px;
|
|
802
|
-
overflow: auto;
|
|
803
793
|
font-size: 85%;
|
|
804
794
|
line-height: 1.45;
|
|
805
795
|
background-color: var(--color-canvas-subtle);
|
|
@@ -817,6 +807,11 @@ body[data-color-mode*='light'] {
|
|
|
817
807
|
background-color: transparent;
|
|
818
808
|
border: 0;
|
|
819
809
|
}
|
|
810
|
+
.wmde-markdown pre > code {
|
|
811
|
+
padding: 16px;
|
|
812
|
+
overflow: auto;
|
|
813
|
+
display: block;
|
|
814
|
+
}
|
|
820
815
|
.wmde-markdown .csv-data td,
|
|
821
816
|
.wmde-markdown .csv-data th {
|
|
822
817
|
padding: 5px;
|
|
@@ -1129,12 +1124,12 @@ body[data-color-mode*='light'] {
|
|
|
1129
1124
|
color: var(--color-prettylights-syntax-entity);
|
|
1130
1125
|
}
|
|
1131
1126
|
.w-md-editor-text-pre .token.bold {
|
|
1132
|
-
font-weight:
|
|
1127
|
+
font-weight: inherit !important;
|
|
1133
1128
|
}
|
|
1134
1129
|
.w-md-editor-text-pre .token.title {
|
|
1135
|
-
line-height:
|
|
1136
|
-
font-size:
|
|
1137
|
-
font-weight:
|
|
1130
|
+
line-height: inherit !important;
|
|
1131
|
+
font-size: inherit !important;
|
|
1132
|
+
font-weight: inherit !important;
|
|
1138
1133
|
}
|
|
1139
1134
|
.w-md-editor-text-pre .token.code.keyword {
|
|
1140
1135
|
color: var(--color-prettylights-syntax-constant) !important;
|