@uiw/react-md-editor 4.0.7 → 4.0.9
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 +104 -2
- package/commands.d.ts +14 -7
- package/dist/mdeditor.css +1 -1
- package/dist/mdeditor.js +231 -233
- package/dist/mdeditor.min.js +1 -1
- package/esm/Editor.d.ts +1 -1
- package/esm/Editor.nohighlight.d.ts +1 -1
- package/esm/commands/index.cn.js +4 -4
- package/esm/commands/index.d.ts +8 -8
- package/esm/commands/index.js +8 -8
- package/esm/commands/title.d.ts +7 -1
- package/esm/commands/title.js +11 -4
- package/esm/commands/title1.d.ts +6 -0
- package/esm/commands/title1.js +16 -9
- package/esm/commands/title2.d.ts +6 -0
- package/esm/commands/title2.js +16 -9
- package/esm/commands/title3.d.ts +6 -0
- package/esm/commands/title3.js +16 -9
- package/esm/commands/title4.d.ts +6 -0
- package/esm/commands/title4.js +16 -9
- package/esm/commands/title5.d.ts +6 -0
- package/esm/commands/title5.js +16 -9
- package/esm/commands/title6.d.ts +6 -0
- package/esm/commands/title6.js +16 -9
- package/esm/components/DragBar/index.d.ts +1 -1
- package/esm/components/TextArea/Markdown.d.ts +1 -1
- package/esm/components/TextArea/Textarea.d.ts +1 -1
- package/esm/components/TextArea/index.d.ts +4 -4
- package/esm/components/TextArea/index.nohighlight.d.ts +3 -3
- package/esm/components/Toolbar/Child.d.ts +1 -1
- package/esm/components/Toolbar/index.d.ts +1 -1
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/lib/Editor.d.ts +1 -1
- package/lib/Editor.nohighlight.d.ts +1 -1
- package/lib/commands/index.cn.js +4 -4
- package/lib/commands/index.d.ts +8 -8
- package/lib/commands/index.js +42 -0
- package/lib/commands/title.d.ts +7 -1
- package/lib/commands/title.js +12 -4
- package/lib/commands/title1.d.ts +6 -0
- package/lib/commands/title1.js +16 -9
- package/lib/commands/title2.d.ts +6 -0
- package/lib/commands/title2.js +16 -9
- package/lib/commands/title3.d.ts +6 -0
- package/lib/commands/title3.js +16 -9
- package/lib/commands/title4.d.ts +6 -0
- package/lib/commands/title4.js +16 -9
- package/lib/commands/title5.d.ts +6 -0
- package/lib/commands/title5.js +16 -9
- package/lib/commands/title6.d.ts +6 -0
- package/lib/commands/title6.js +16 -9
- package/lib/components/DragBar/index.d.ts +1 -1
- package/lib/components/TextArea/Markdown.d.ts +1 -1
- package/lib/components/TextArea/Textarea.d.ts +1 -1
- package/lib/components/TextArea/index.d.ts +4 -4
- package/lib/components/TextArea/index.nohighlight.d.ts +3 -3
- package/lib/components/Toolbar/Child.d.ts +1 -1
- package/lib/components/Toolbar/index.d.ts +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +26 -1
- package/nohighlight.d.ts +2 -0
- package/package.json +1 -1
- package/src/Editor.nohighlight.tsx +2 -2
- package/src/Editor.tsx +3 -3
- package/src/commands/index.cn.ts +3 -3
- package/src/commands/index.ts +14 -7
- package/src/commands/title.tsx +11 -4
- package/src/commands/title1.tsx +14 -7
- package/src/commands/title2.tsx +14 -7
- package/src/commands/title3.tsx +14 -7
- package/src/commands/title4.tsx +14 -7
- package/src/commands/title5.tsx +14 -7
- package/src/commands/title6.tsx +14 -7
- package/src/components/DragBar/index.tsx +1 -1
- package/src/components/TextArea/Markdown.tsx +1 -1
- package/src/components/TextArea/Textarea.tsx +2 -2
- package/src/components/TextArea/index.nohighlight.tsx +5 -4
- package/src/components/TextArea/index.tsx +6 -5
- package/src/components/Toolbar/Child.tsx +1 -1
- package/src/components/Toolbar/index.tsx +2 -2
- package/src/index.tsx +3 -0
package/esm/Editor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import MarkdownPreview from '@uiw/react-markdown-preview';
|
|
3
|
-
import { ContextStore } from './Context';
|
|
3
|
+
import { type ContextStore } from './Context';
|
|
4
4
|
import type { MDEditorProps } from './Types';
|
|
5
5
|
export interface RefMDEditor extends ContextStore {
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import MarkdownPreview from '@uiw/react-markdown-preview/nohighlight';
|
|
3
|
-
import { ContextStore } from './Context';
|
|
3
|
+
import { type ContextStore } from './Context';
|
|
4
4
|
import type { MDEditorProps } from './Types';
|
|
5
5
|
export interface RefMDEditor extends ContextStore {
|
|
6
6
|
}
|
package/esm/commands/index.cn.js
CHANGED
|
@@ -55,8 +55,8 @@ var fullscreen = _extends({}, fullscreenInit, {
|
|
|
55
55
|
});
|
|
56
56
|
var hr = _extends({}, hrInit, {
|
|
57
57
|
buttonProps: {
|
|
58
|
-
'aria-label': '
|
|
59
|
-
title: '
|
|
58
|
+
'aria-label': '插入分割线 (ctrl + h)',
|
|
59
|
+
title: '插入分割线 (ctrl + h)'
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
var image = _extends({}, imageInit, {
|
|
@@ -121,8 +121,8 @@ var quote = _extends({}, quoteInit, {
|
|
|
121
121
|
});
|
|
122
122
|
var strikethrough = _extends({}, strikethroughInit, {
|
|
123
123
|
buttonProps: {
|
|
124
|
-
'aria-label': '
|
|
125
|
-
title: '
|
|
124
|
+
'aria-label': '添加删除线文本 (ctrl + shift + x)',
|
|
125
|
+
title: '添加删除线文本 (ctrl + shift + x)'
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
var issue = _extends({}, issueInit, {
|
package/esm/commands/index.d.ts
CHANGED
|
@@ -14,13 +14,13 @@ import { checkedListCommand, orderedListCommand, unorderedListCommand } from './
|
|
|
14
14
|
import { codeEdit, codeLive, codePreview } from './preview';
|
|
15
15
|
import { quote } from './quote';
|
|
16
16
|
import { strikethrough } from './strikeThrough';
|
|
17
|
-
import { title } from './title';
|
|
18
|
-
import { title1 } from './title1';
|
|
19
|
-
import { title2 } from './title2';
|
|
20
|
-
import { title3 } from './title3';
|
|
21
|
-
import { title4 } from './title4';
|
|
22
|
-
import { title5 } from './title5';
|
|
23
|
-
import { title6 } from './title6';
|
|
17
|
+
import { title, heading } from './title';
|
|
18
|
+
import { title1, heading1 } from './title1';
|
|
19
|
+
import { title2, heading2 } from './title2';
|
|
20
|
+
import { title3, heading3 } from './title3';
|
|
21
|
+
import { title4, heading4 } from './title4';
|
|
22
|
+
import { title5, heading5 } from './title5';
|
|
23
|
+
import { title6, heading6 } from './title6';
|
|
24
24
|
import { table } from './table';
|
|
25
25
|
import { issue } from './issue';
|
|
26
26
|
import { help } from './help';
|
|
@@ -93,4 +93,4 @@ declare class TextAreaCommandOrchestrator implements CommandOrchestrator {
|
|
|
93
93
|
getState(): false | TextState;
|
|
94
94
|
executeCommand(command: ICommand<string>, dispatch?: React.Dispatch<ContextStore>, state?: ExecuteCommandState, shortcuts?: string[]): void;
|
|
95
95
|
}
|
|
96
|
-
export { title, title1, title2, title3, title4, title5, title6, bold, codeBlock, comment, italic, strikethrough, hr, group, divider, link, quote, code, image, unorderedListCommand, orderedListCommand, checkedListCommand, table, issue, help, codeEdit, codeLive, codePreview, fullscreen, getCommands, getExtraCommands, getStateFromTextArea, TextAreaCommandOrchestrator, TextAreaTextApi, };
|
|
96
|
+
export { title, title1, title2, title3, title4, title5, title6, heading, heading1, heading2, heading3, heading4, heading5, heading6, bold, codeBlock, comment, italic, strikethrough, hr, group, divider, link, quote, code, image, unorderedListCommand, orderedListCommand, checkedListCommand, table, issue, help, codeEdit, codeLive, codePreview, fullscreen, getCommands, getExtraCommands, getStateFromTextArea, TextAreaCommandOrchestrator, TextAreaTextApi, };
|
package/esm/commands/index.js
CHANGED
|
@@ -14,13 +14,13 @@ import { checkedListCommand, orderedListCommand, unorderedListCommand } from "./
|
|
|
14
14
|
import { codeEdit, codeLive, codePreview } from "./preview.js";
|
|
15
15
|
import { quote } from "./quote.js";
|
|
16
16
|
import { strikethrough } from "./strikeThrough.js";
|
|
17
|
-
import { title } from "./title.js";
|
|
18
|
-
import { title1 } from "./title1.js";
|
|
19
|
-
import { title2 } from "./title2.js";
|
|
20
|
-
import { title3 } from "./title3.js";
|
|
21
|
-
import { title4 } from "./title4.js";
|
|
22
|
-
import { title5 } from "./title5.js";
|
|
23
|
-
import { title6 } from "./title6.js";
|
|
17
|
+
import { title, heading } from "./title.js";
|
|
18
|
+
import { title1, heading1 } from "./title1.js";
|
|
19
|
+
import { title2, heading2 } from "./title2.js";
|
|
20
|
+
import { title3, heading3 } from "./title3.js";
|
|
21
|
+
import { title4, heading4 } from "./title4.js";
|
|
22
|
+
import { title5, heading5 } from "./title5.js";
|
|
23
|
+
import { title6, heading6 } from "./title6.js";
|
|
24
24
|
import { table } from "./table.js";
|
|
25
25
|
import { issue } from "./issue.js";
|
|
26
26
|
import { help } from "./help.js";
|
|
@@ -88,6 +88,6 @@ class TextAreaCommandOrchestrator {
|
|
|
88
88
|
}, getStateFromTextArea(this.textArea)), this.textApi, dispatch, state, shortcuts);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
export { title, title1, title2, title3, title4, title5, title6, bold, codeBlock, comment, italic, strikethrough, hr, group, divider, link, quote, code, image, unorderedListCommand, orderedListCommand, checkedListCommand, table, issue, help, codeEdit, codeLive, codePreview, fullscreen,
|
|
91
|
+
export { title, title1, title2, title3, title4, title5, title6, heading, heading1, heading2, heading3, heading4, heading5, heading6, bold, codeBlock, comment, italic, strikethrough, hr, group, divider, link, quote, code, image, unorderedListCommand, orderedListCommand, checkedListCommand, table, issue, help, codeEdit, codeLive, codePreview, fullscreen,
|
|
92
92
|
// Tool method.
|
|
93
93
|
getCommands, getExtraCommands, getStateFromTextArea, TextAreaCommandOrchestrator, TextAreaTextApi };
|
package/esm/commands/title.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ICommand, ExecuteState, TextAreaTextApi } from './';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function headingExecute({ state, api, prefix, suffix, }: {
|
|
3
3
|
state: ExecuteState;
|
|
4
4
|
api: TextAreaTextApi;
|
|
5
5
|
prefix: string;
|
|
6
6
|
suffix?: string;
|
|
7
7
|
}): void;
|
|
8
|
+
export declare const heading: ICommand;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `heading` instead.
|
|
11
|
+
* This command is now deprecated and will be removed in future versions.
|
|
12
|
+
* Use `title` for inserting headings.
|
|
13
|
+
*/
|
|
8
14
|
export declare const title: ICommand;
|
package/esm/commands/title.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { heading1 } from "./title1.js";
|
|
4
4
|
import { selectLine, executeCommand } from "../utils/markdownUtils.js";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
export function
|
|
6
|
+
export function headingExecute(_ref) {
|
|
7
7
|
var {
|
|
8
8
|
state,
|
|
9
9
|
api,
|
|
@@ -23,7 +23,7 @@ export function titleExecute(_ref) {
|
|
|
23
23
|
suffix
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
export var
|
|
26
|
+
export var heading = _extends({}, heading1, {
|
|
27
27
|
icon: /*#__PURE__*/_jsx("svg", {
|
|
28
28
|
width: "12",
|
|
29
29
|
height: "12",
|
|
@@ -33,4 +33,11 @@ export var title = _extends({}, title1, {
|
|
|
33
33
|
d: "M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z"
|
|
34
34
|
})
|
|
35
35
|
})
|
|
36
|
-
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `heading` instead.
|
|
40
|
+
* This command is now deprecated and will be removed in future versions.
|
|
41
|
+
* Use `title` for inserting headings.
|
|
42
|
+
*/
|
|
43
|
+
export var title = heading;
|
package/esm/commands/title1.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ICommand } from './';
|
|
2
|
+
export declare const heading1: ICommand;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `heading1` instead.
|
|
5
|
+
* This command is now deprecated and will be removed in future versions.
|
|
6
|
+
* Use `title1` for inserting Heading 1.
|
|
7
|
+
*/
|
|
2
8
|
export declare const title1: ICommand;
|
package/esm/commands/title1.js
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from "../commands/title.js";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export var
|
|
5
|
-
name: '
|
|
6
|
-
keyCommand: '
|
|
4
|
+
export var heading1 = {
|
|
5
|
+
name: 'heading1',
|
|
6
|
+
keyCommand: 'heading1',
|
|
7
7
|
shortcuts: 'ctrlcmd+1',
|
|
8
8
|
prefix: '# ',
|
|
9
9
|
suffix: '',
|
|
10
10
|
buttonProps: {
|
|
11
|
-
'aria-label': 'Insert
|
|
12
|
-
title: 'Insert
|
|
11
|
+
'aria-label': 'Insert Heading 1 (ctrl + 1)',
|
|
12
|
+
title: 'Insert Heading 1 (ctrl + 1)'
|
|
13
13
|
},
|
|
14
14
|
icon: /*#__PURE__*/_jsx("div", {
|
|
15
15
|
style: {
|
|
16
16
|
fontSize: 18,
|
|
17
17
|
textAlign: 'left'
|
|
18
18
|
},
|
|
19
|
-
children: "
|
|
19
|
+
children: "Heading 1"
|
|
20
20
|
}),
|
|
21
21
|
execute: (state, api) => {
|
|
22
|
-
|
|
22
|
+
headingExecute({
|
|
23
23
|
state,
|
|
24
24
|
api,
|
|
25
25
|
prefix: state.command.prefix,
|
|
26
26
|
suffix: state.command.suffix
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `heading1` instead.
|
|
33
|
+
* This command is now deprecated and will be removed in future versions.
|
|
34
|
+
* Use `title1` for inserting Heading 1.
|
|
35
|
+
*/
|
|
36
|
+
export var title1 = heading1;
|
package/esm/commands/title2.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ICommand } from './';
|
|
2
|
+
export declare const heading2: ICommand;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `heading2` instead.
|
|
5
|
+
* This command is now deprecated and will be removed in future versions.
|
|
6
|
+
* Use `title2` for inserting Heading 2.
|
|
7
|
+
*/
|
|
2
8
|
export declare const title2: ICommand;
|
package/esm/commands/title2.js
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from "../commands/title.js";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export var
|
|
5
|
-
name: '
|
|
6
|
-
keyCommand: '
|
|
4
|
+
export var heading2 = {
|
|
5
|
+
name: 'heading2',
|
|
6
|
+
keyCommand: 'heading2',
|
|
7
7
|
shortcuts: 'ctrlcmd+2',
|
|
8
8
|
prefix: '## ',
|
|
9
9
|
suffix: '',
|
|
10
10
|
buttonProps: {
|
|
11
|
-
'aria-label': 'Insert
|
|
12
|
-
title: 'Insert
|
|
11
|
+
'aria-label': 'Insert Heading 2 (ctrl + 2)',
|
|
12
|
+
title: 'Insert Heading 2 (ctrl + 2)'
|
|
13
13
|
},
|
|
14
14
|
icon: /*#__PURE__*/_jsx("div", {
|
|
15
15
|
style: {
|
|
16
16
|
fontSize: 16,
|
|
17
17
|
textAlign: 'left'
|
|
18
18
|
},
|
|
19
|
-
children: "
|
|
19
|
+
children: "Heading 2"
|
|
20
20
|
}),
|
|
21
21
|
execute: (state, api) => {
|
|
22
|
-
|
|
22
|
+
headingExecute({
|
|
23
23
|
state,
|
|
24
24
|
api,
|
|
25
25
|
prefix: state.command.prefix,
|
|
26
26
|
suffix: state.command.suffix
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `heading2` instead.
|
|
33
|
+
* This command is now deprecated and will be removed in future versions.
|
|
34
|
+
* Use `title2` for inserting Heading 2.
|
|
35
|
+
*/
|
|
36
|
+
export var title2 = heading2;
|
package/esm/commands/title3.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ICommand } from './';
|
|
2
|
+
export declare const heading3: ICommand;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `heading3` instead.
|
|
5
|
+
* This command is now deprecated and will be removed in future versions.
|
|
6
|
+
* Use `title3` for inserting Heading 3.
|
|
7
|
+
*/
|
|
2
8
|
export declare const title3: ICommand;
|
package/esm/commands/title3.js
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from "../commands/title.js";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export var
|
|
5
|
-
name: '
|
|
6
|
-
keyCommand: '
|
|
4
|
+
export var heading3 = {
|
|
5
|
+
name: 'heading3',
|
|
6
|
+
keyCommand: 'heading3',
|
|
7
7
|
shortcuts: 'ctrlcmd+3',
|
|
8
8
|
prefix: '### ',
|
|
9
9
|
suffix: '',
|
|
10
10
|
buttonProps: {
|
|
11
|
-
'aria-label': 'Insert
|
|
12
|
-
title: 'Insert
|
|
11
|
+
'aria-label': 'Insert Heading 3 (ctrl + 3)',
|
|
12
|
+
title: 'Insert Heading 3 (ctrl + 3)'
|
|
13
13
|
},
|
|
14
14
|
icon: /*#__PURE__*/_jsx("div", {
|
|
15
15
|
style: {
|
|
16
16
|
fontSize: 15,
|
|
17
17
|
textAlign: 'left'
|
|
18
18
|
},
|
|
19
|
-
children: "
|
|
19
|
+
children: "Heading 3"
|
|
20
20
|
}),
|
|
21
21
|
execute: (state, api) => {
|
|
22
|
-
|
|
22
|
+
headingExecute({
|
|
23
23
|
state,
|
|
24
24
|
api,
|
|
25
25
|
prefix: state.command.prefix,
|
|
26
26
|
suffix: state.command.suffix
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `heading3` instead.
|
|
33
|
+
* This command is now deprecated and will be removed in future versions.
|
|
34
|
+
* Use `title3` for inserting Heading 3.
|
|
35
|
+
*/
|
|
36
|
+
export var title3 = heading3;
|
package/esm/commands/title4.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ICommand } from './';
|
|
2
|
+
export declare const heading4: ICommand;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `heading4` instead.
|
|
5
|
+
* This command is now deprecated and will be removed in future versions.
|
|
6
|
+
* Use `title4` for inserting Heading 4.
|
|
7
|
+
*/
|
|
2
8
|
export declare const title4: ICommand;
|
package/esm/commands/title4.js
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from "../commands/title.js";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export var
|
|
5
|
-
name: '
|
|
6
|
-
keyCommand: '
|
|
4
|
+
export var heading4 = {
|
|
5
|
+
name: 'heading4',
|
|
6
|
+
keyCommand: 'heading4',
|
|
7
7
|
shortcuts: 'ctrlcmd+4',
|
|
8
8
|
prefix: '#### ',
|
|
9
9
|
suffix: '',
|
|
10
10
|
buttonProps: {
|
|
11
|
-
'aria-label': 'Insert
|
|
12
|
-
title: 'Insert
|
|
11
|
+
'aria-label': 'Insert Heading 4 (ctrl + 4)',
|
|
12
|
+
title: 'Insert Heading 4 (ctrl + 4)'
|
|
13
13
|
},
|
|
14
14
|
icon: /*#__PURE__*/_jsx("div", {
|
|
15
15
|
style: {
|
|
16
16
|
fontSize: 14,
|
|
17
17
|
textAlign: 'left'
|
|
18
18
|
},
|
|
19
|
-
children: "
|
|
19
|
+
children: "Heading 4"
|
|
20
20
|
}),
|
|
21
21
|
execute: (state, api) => {
|
|
22
|
-
|
|
22
|
+
headingExecute({
|
|
23
23
|
state,
|
|
24
24
|
api,
|
|
25
25
|
prefix: state.command.prefix,
|
|
26
26
|
suffix: state.command.suffix
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `heading4` instead.
|
|
33
|
+
* This command is now deprecated and will be removed in future versions.
|
|
34
|
+
* Use `title4` for inserting Heading 4.
|
|
35
|
+
*/
|
|
36
|
+
export var title4 = heading4;
|
package/esm/commands/title5.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ICommand } from './';
|
|
2
|
+
export declare const heading5: ICommand;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `heading5` instead.
|
|
5
|
+
* This command is now deprecated and will be removed in future versions.
|
|
6
|
+
* Use `title5` for inserting Heading 5.
|
|
7
|
+
*/
|
|
2
8
|
export declare const title5: ICommand;
|
package/esm/commands/title5.js
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from "../commands/title.js";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export var
|
|
5
|
-
name: '
|
|
6
|
-
keyCommand: '
|
|
4
|
+
export var heading5 = {
|
|
5
|
+
name: 'heading5',
|
|
6
|
+
keyCommand: 'heading5',
|
|
7
7
|
shortcuts: 'ctrlcmd+5',
|
|
8
8
|
prefix: '##### ',
|
|
9
9
|
suffix: '',
|
|
10
10
|
buttonProps: {
|
|
11
|
-
'aria-label': 'Insert
|
|
12
|
-
title: 'Insert
|
|
11
|
+
'aria-label': 'Insert Heading 5 (ctrl + 5)',
|
|
12
|
+
title: 'Insert Heading 5 (ctrl + 5)'
|
|
13
13
|
},
|
|
14
14
|
icon: /*#__PURE__*/_jsx("div", {
|
|
15
15
|
style: {
|
|
16
16
|
fontSize: 12,
|
|
17
17
|
textAlign: 'left'
|
|
18
18
|
},
|
|
19
|
-
children: "
|
|
19
|
+
children: "Heading 5"
|
|
20
20
|
}),
|
|
21
21
|
execute: (state, api) => {
|
|
22
|
-
|
|
22
|
+
headingExecute({
|
|
23
23
|
state,
|
|
24
24
|
api,
|
|
25
25
|
prefix: state.command.prefix,
|
|
26
26
|
suffix: state.command.suffix
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `heading5` instead.
|
|
33
|
+
* This command is now deprecated and will be removed in future versions.
|
|
34
|
+
* Use `title5` for inserting Heading 5.
|
|
35
|
+
*/
|
|
36
|
+
export var title5 = heading5;
|
package/esm/commands/title6.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ICommand } from './';
|
|
2
|
+
export declare const heading6: ICommand;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `heading6` instead.
|
|
5
|
+
* This command is now deprecated and will be removed in future versions.
|
|
6
|
+
* Use `title6` for inserting Heading 6.
|
|
7
|
+
*/
|
|
2
8
|
export declare const title6: ICommand;
|
package/esm/commands/title6.js
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from "../commands/title.js";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export var
|
|
5
|
-
name: '
|
|
6
|
-
keyCommand: '
|
|
4
|
+
export var heading6 = {
|
|
5
|
+
name: 'heading6',
|
|
6
|
+
keyCommand: 'heading6',
|
|
7
7
|
shortcuts: 'ctrlcmd+6',
|
|
8
8
|
prefix: '###### ',
|
|
9
9
|
suffix: '',
|
|
10
10
|
buttonProps: {
|
|
11
|
-
'aria-label': 'Insert
|
|
12
|
-
title: 'Insert
|
|
11
|
+
'aria-label': 'Insert Heading 6 (ctrl + 6)',
|
|
12
|
+
title: 'Insert Heading 6 (ctrl + 6)'
|
|
13
13
|
},
|
|
14
14
|
icon: /*#__PURE__*/_jsx("div", {
|
|
15
15
|
style: {
|
|
16
16
|
fontSize: 12,
|
|
17
17
|
textAlign: 'left'
|
|
18
18
|
},
|
|
19
|
-
children: "
|
|
19
|
+
children: "Heading 6"
|
|
20
20
|
}),
|
|
21
21
|
execute: (state, api) => {
|
|
22
|
-
|
|
22
|
+
headingExecute({
|
|
23
23
|
state,
|
|
24
24
|
api,
|
|
25
25
|
prefix: state.command.prefix,
|
|
26
26
|
suffix: state.command.suffix
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `heading6` instead.
|
|
33
|
+
* This command is now deprecated and will be removed in future versions.
|
|
34
|
+
* Use `title6` for inserting Heading 6.
|
|
35
|
+
*/
|
|
36
|
+
export var title6 = heading6;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IProps } from '../../Types';
|
|
2
|
+
import { type IProps } from '../../Types';
|
|
3
3
|
export interface MarkdownProps extends IProps, React.HTMLAttributes<HTMLPreElement> {
|
|
4
4
|
}
|
|
5
5
|
export default function Markdown(props: MarkdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
|
-
import { ContextStore, ExecuteCommandState } from '../../Context';
|
|
3
|
-
import { TextAreaProps } from './Textarea';
|
|
4
|
-
import { IProps } from '../../Types';
|
|
5
|
-
import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
|
|
2
|
+
import { type ContextStore, type ExecuteCommandState } from '../../Context';
|
|
3
|
+
import { type TextAreaProps } from './Textarea';
|
|
4
|
+
import { type IProps } from '../../Types';
|
|
5
|
+
import { TextAreaCommandOrchestrator, type ICommand } from '../../commands/';
|
|
6
6
|
import './index.less';
|
|
7
7
|
type RenderTextareaHandle = {
|
|
8
8
|
dispatch: ContextStore['dispatch'];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
|
-
import { ContextStore, ExecuteCommandState } from '../../Context';
|
|
2
|
+
import { type ContextStore, ExecuteCommandState } from '../../Context';
|
|
3
3
|
import { TextAreaProps } from './Textarea';
|
|
4
|
-
import { IProps } from '../../Types';
|
|
5
|
-
import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
|
|
4
|
+
import { type IProps } from '../../Types';
|
|
5
|
+
import { TextAreaCommandOrchestrator, type ICommand } from '../../commands/';
|
|
6
6
|
import './index.less';
|
|
7
7
|
type RenderTextareaHandle = {
|
|
8
8
|
dispatch: ContextStore['dispatch'];
|
package/esm/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import MDEditor from './Editor';
|
|
|
2
2
|
import * as commands from './commands/';
|
|
3
3
|
import * as MarkdownUtil from './utils/markdownUtils';
|
|
4
4
|
import './index.less';
|
|
5
|
+
export { headingExecute } from './commands/title';
|
|
5
6
|
export * from './commands/';
|
|
6
7
|
export * from './commands/group';
|
|
7
8
|
export * from './utils/markdownUtils';
|
|
@@ -9,5 +10,7 @@ export * from './utils/InsertTextAtPosition';
|
|
|
9
10
|
export * from './Editor';
|
|
10
11
|
export * from './Context';
|
|
11
12
|
export * from './Types';
|
|
13
|
+
export { default as handleKeyDown } from './components/TextArea/handleKeyDown';
|
|
14
|
+
export { default as shortcuts } from './components/TextArea/shortcuts';
|
|
12
15
|
export { MarkdownUtil, commands };
|
|
13
16
|
export default MDEditor;
|
package/esm/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import MDEditor from "./Editor.js";
|
|
|
2
2
|
import * as commands from "./commands/index.js";
|
|
3
3
|
import * as MarkdownUtil from "./utils/markdownUtils.js";
|
|
4
4
|
import "./index.css";
|
|
5
|
+
export { headingExecute } from "./commands/title.js";
|
|
5
6
|
export * from "./commands/index.js";
|
|
6
7
|
export * from "./commands/group.js";
|
|
7
8
|
export * from "./utils/markdownUtils.js";
|
|
@@ -9,5 +10,7 @@ export * from "./utils/InsertTextAtPosition.js";
|
|
|
9
10
|
export * from "./Editor.js";
|
|
10
11
|
export * from "./Context.js";
|
|
11
12
|
export * from "./Types.js";
|
|
13
|
+
export { default as handleKeyDown } from "./components/TextArea/handleKeyDown.js";
|
|
14
|
+
export { default as shortcuts } from "./components/TextArea/shortcuts.js";
|
|
12
15
|
export { MarkdownUtil, commands };
|
|
13
16
|
export default MDEditor;
|
package/lib/Editor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import MarkdownPreview from '@uiw/react-markdown-preview';
|
|
3
|
-
import { ContextStore } from './Context';
|
|
3
|
+
import { type ContextStore } from './Context';
|
|
4
4
|
import type { MDEditorProps } from './Types';
|
|
5
5
|
export interface RefMDEditor extends ContextStore {
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import MarkdownPreview from '@uiw/react-markdown-preview/nohighlight';
|
|
3
|
-
import { ContextStore } from './Context';
|
|
3
|
+
import { type ContextStore } from './Context';
|
|
4
4
|
import type { MDEditorProps } from './Types';
|
|
5
5
|
export interface RefMDEditor extends ContextStore {
|
|
6
6
|
}
|
package/lib/commands/index.cn.js
CHANGED
|
@@ -76,8 +76,8 @@ var fullscreen = exports.fullscreen = (0, _objectSpread2["default"])((0, _object
|
|
|
76
76
|
});
|
|
77
77
|
var hr = exports.hr = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _hr.hr), {}, {
|
|
78
78
|
buttonProps: {
|
|
79
|
-
'aria-label': '
|
|
80
|
-
title: '
|
|
79
|
+
'aria-label': '插入分割线 (ctrl + h)',
|
|
80
|
+
title: '插入分割线 (ctrl + h)'
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
var image = exports.image = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _image.image), {}, {
|
|
@@ -142,8 +142,8 @@ var quote = exports.quote = (0, _objectSpread2["default"])((0, _objectSpread2["d
|
|
|
142
142
|
});
|
|
143
143
|
var strikethrough = exports.strikethrough = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _strikeThrough.strikethrough), {}, {
|
|
144
144
|
buttonProps: {
|
|
145
|
-
'aria-label': '
|
|
146
|
-
title: '
|
|
145
|
+
'aria-label': '添加删除线文本 (ctrl + shift + x)',
|
|
146
|
+
title: '添加删除线文本 (ctrl + shift + x)'
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
var issue = exports.issue = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _issue.issue), {}, {
|