@uiw/react-md-editor 4.0.7 → 4.0.8
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 +36 -1
- package/commands.d.ts +14 -7
- package/dist/mdeditor.js +53 -11
- package/dist/mdeditor.min.js +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/index.css +0 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- 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/index.d.ts +1 -0
- package/lib/index.js +9 -1
- package/markdown-editor.css +0 -1
- package/nohighlight.d.ts +2 -0
- package/package.json +1 -1
- 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/index.tsx +1 -0
package/lib/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/lib/commands/title1.js
CHANGED
|
@@ -4,33 +4,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.title1 = void 0;
|
|
7
|
+
exports.title1 = exports.heading1 = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _title = require("../commands/title");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var
|
|
12
|
-
name: '
|
|
13
|
-
keyCommand: '
|
|
11
|
+
var heading1 = exports.heading1 = {
|
|
12
|
+
name: 'heading1',
|
|
13
|
+
keyCommand: 'heading1',
|
|
14
14
|
shortcuts: 'ctrlcmd+1',
|
|
15
15
|
prefix: '# ',
|
|
16
16
|
suffix: '',
|
|
17
17
|
buttonProps: {
|
|
18
|
-
'aria-label': 'Insert
|
|
19
|
-
title: 'Insert
|
|
18
|
+
'aria-label': 'Insert Heading 1 (ctrl + 1)',
|
|
19
|
+
title: 'Insert Heading 1 (ctrl + 1)'
|
|
20
20
|
},
|
|
21
21
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
style: {
|
|
23
23
|
fontSize: 18,
|
|
24
24
|
textAlign: 'left'
|
|
25
25
|
},
|
|
26
|
-
children: "
|
|
26
|
+
children: "Heading 1"
|
|
27
27
|
}),
|
|
28
28
|
execute: function execute(state, api) {
|
|
29
|
-
(0, _title.
|
|
29
|
+
(0, _title.headingExecute)({
|
|
30
30
|
state: state,
|
|
31
31
|
api: api,
|
|
32
32
|
prefix: state.command.prefix,
|
|
33
33
|
suffix: state.command.suffix
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `heading1` instead.
|
|
40
|
+
* This command is now deprecated and will be removed in future versions.
|
|
41
|
+
* Use `title1` for inserting Heading 1.
|
|
42
|
+
*/
|
|
43
|
+
var title1 = exports.title1 = heading1;
|
package/lib/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/lib/commands/title2.js
CHANGED
|
@@ -4,33 +4,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.title2 = void 0;
|
|
7
|
+
exports.title2 = exports.heading2 = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _title = require("../commands/title");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var
|
|
12
|
-
name: '
|
|
13
|
-
keyCommand: '
|
|
11
|
+
var heading2 = exports.heading2 = {
|
|
12
|
+
name: 'heading2',
|
|
13
|
+
keyCommand: 'heading2',
|
|
14
14
|
shortcuts: 'ctrlcmd+2',
|
|
15
15
|
prefix: '## ',
|
|
16
16
|
suffix: '',
|
|
17
17
|
buttonProps: {
|
|
18
|
-
'aria-label': 'Insert
|
|
19
|
-
title: 'Insert
|
|
18
|
+
'aria-label': 'Insert Heading 2 (ctrl + 2)',
|
|
19
|
+
title: 'Insert Heading 2 (ctrl + 2)'
|
|
20
20
|
},
|
|
21
21
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
style: {
|
|
23
23
|
fontSize: 16,
|
|
24
24
|
textAlign: 'left'
|
|
25
25
|
},
|
|
26
|
-
children: "
|
|
26
|
+
children: "Heading 2"
|
|
27
27
|
}),
|
|
28
28
|
execute: function execute(state, api) {
|
|
29
|
-
(0, _title.
|
|
29
|
+
(0, _title.headingExecute)({
|
|
30
30
|
state: state,
|
|
31
31
|
api: api,
|
|
32
32
|
prefix: state.command.prefix,
|
|
33
33
|
suffix: state.command.suffix
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `heading2` instead.
|
|
40
|
+
* This command is now deprecated and will be removed in future versions.
|
|
41
|
+
* Use `title2` for inserting Heading 2.
|
|
42
|
+
*/
|
|
43
|
+
var title2 = exports.title2 = heading2;
|
package/lib/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/lib/commands/title3.js
CHANGED
|
@@ -4,33 +4,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.title3 = void 0;
|
|
7
|
+
exports.title3 = exports.heading3 = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _title = require("../commands/title");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var
|
|
12
|
-
name: '
|
|
13
|
-
keyCommand: '
|
|
11
|
+
var heading3 = exports.heading3 = {
|
|
12
|
+
name: 'heading3',
|
|
13
|
+
keyCommand: 'heading3',
|
|
14
14
|
shortcuts: 'ctrlcmd+3',
|
|
15
15
|
prefix: '### ',
|
|
16
16
|
suffix: '',
|
|
17
17
|
buttonProps: {
|
|
18
|
-
'aria-label': 'Insert
|
|
19
|
-
title: 'Insert
|
|
18
|
+
'aria-label': 'Insert Heading 3 (ctrl + 3)',
|
|
19
|
+
title: 'Insert Heading 3 (ctrl + 3)'
|
|
20
20
|
},
|
|
21
21
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
style: {
|
|
23
23
|
fontSize: 15,
|
|
24
24
|
textAlign: 'left'
|
|
25
25
|
},
|
|
26
|
-
children: "
|
|
26
|
+
children: "Heading 3"
|
|
27
27
|
}),
|
|
28
28
|
execute: function execute(state, api) {
|
|
29
|
-
(0, _title.
|
|
29
|
+
(0, _title.headingExecute)({
|
|
30
30
|
state: state,
|
|
31
31
|
api: api,
|
|
32
32
|
prefix: state.command.prefix,
|
|
33
33
|
suffix: state.command.suffix
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `heading3` instead.
|
|
40
|
+
* This command is now deprecated and will be removed in future versions.
|
|
41
|
+
* Use `title3` for inserting Heading 3.
|
|
42
|
+
*/
|
|
43
|
+
var title3 = exports.title3 = heading3;
|
package/lib/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/lib/commands/title4.js
CHANGED
|
@@ -4,33 +4,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.title4 = void 0;
|
|
7
|
+
exports.title4 = exports.heading4 = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _title = require("../commands/title");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var
|
|
12
|
-
name: '
|
|
13
|
-
keyCommand: '
|
|
11
|
+
var heading4 = exports.heading4 = {
|
|
12
|
+
name: 'heading4',
|
|
13
|
+
keyCommand: 'heading4',
|
|
14
14
|
shortcuts: 'ctrlcmd+4',
|
|
15
15
|
prefix: '#### ',
|
|
16
16
|
suffix: '',
|
|
17
17
|
buttonProps: {
|
|
18
|
-
'aria-label': 'Insert
|
|
19
|
-
title: 'Insert
|
|
18
|
+
'aria-label': 'Insert Heading 4 (ctrl + 4)',
|
|
19
|
+
title: 'Insert Heading 4 (ctrl + 4)'
|
|
20
20
|
},
|
|
21
21
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
style: {
|
|
23
23
|
fontSize: 14,
|
|
24
24
|
textAlign: 'left'
|
|
25
25
|
},
|
|
26
|
-
children: "
|
|
26
|
+
children: "Heading 4"
|
|
27
27
|
}),
|
|
28
28
|
execute: function execute(state, api) {
|
|
29
|
-
(0, _title.
|
|
29
|
+
(0, _title.headingExecute)({
|
|
30
30
|
state: state,
|
|
31
31
|
api: api,
|
|
32
32
|
prefix: state.command.prefix,
|
|
33
33
|
suffix: state.command.suffix
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `heading4` instead.
|
|
40
|
+
* This command is now deprecated and will be removed in future versions.
|
|
41
|
+
* Use `title4` for inserting Heading 4.
|
|
42
|
+
*/
|
|
43
|
+
var title4 = exports.title4 = heading4;
|
package/lib/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/lib/commands/title5.js
CHANGED
|
@@ -4,33 +4,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.title5 = void 0;
|
|
7
|
+
exports.title5 = exports.heading5 = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _title = require("../commands/title");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var
|
|
12
|
-
name: '
|
|
13
|
-
keyCommand: '
|
|
11
|
+
var heading5 = exports.heading5 = {
|
|
12
|
+
name: 'heading5',
|
|
13
|
+
keyCommand: 'heading5',
|
|
14
14
|
shortcuts: 'ctrlcmd+5',
|
|
15
15
|
prefix: '##### ',
|
|
16
16
|
suffix: '',
|
|
17
17
|
buttonProps: {
|
|
18
|
-
'aria-label': 'Insert
|
|
19
|
-
title: 'Insert
|
|
18
|
+
'aria-label': 'Insert Heading 5 (ctrl + 5)',
|
|
19
|
+
title: 'Insert Heading 5 (ctrl + 5)'
|
|
20
20
|
},
|
|
21
21
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
style: {
|
|
23
23
|
fontSize: 12,
|
|
24
24
|
textAlign: 'left'
|
|
25
25
|
},
|
|
26
|
-
children: "
|
|
26
|
+
children: "Heading 5"
|
|
27
27
|
}),
|
|
28
28
|
execute: function execute(state, api) {
|
|
29
|
-
(0, _title.
|
|
29
|
+
(0, _title.headingExecute)({
|
|
30
30
|
state: state,
|
|
31
31
|
api: api,
|
|
32
32
|
prefix: state.command.prefix,
|
|
33
33
|
suffix: state.command.suffix
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `heading5` instead.
|
|
40
|
+
* This command is now deprecated and will be removed in future versions.
|
|
41
|
+
* Use `title5` for inserting Heading 5.
|
|
42
|
+
*/
|
|
43
|
+
var title5 = exports.title5 = heading5;
|
package/lib/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/lib/commands/title6.js
CHANGED
|
@@ -4,33 +4,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.title6 = void 0;
|
|
7
|
+
exports.title6 = exports.heading6 = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _title = require("../commands/title");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var
|
|
12
|
-
name: '
|
|
13
|
-
keyCommand: '
|
|
11
|
+
var heading6 = exports.heading6 = {
|
|
12
|
+
name: 'heading6',
|
|
13
|
+
keyCommand: 'heading6',
|
|
14
14
|
shortcuts: 'ctrlcmd+6',
|
|
15
15
|
prefix: '###### ',
|
|
16
16
|
suffix: '',
|
|
17
17
|
buttonProps: {
|
|
18
|
-
'aria-label': 'Insert
|
|
19
|
-
title: 'Insert
|
|
18
|
+
'aria-label': 'Insert Heading 6 (ctrl + 6)',
|
|
19
|
+
title: 'Insert Heading 6 (ctrl + 6)'
|
|
20
20
|
},
|
|
21
21
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
style: {
|
|
23
23
|
fontSize: 12,
|
|
24
24
|
textAlign: 'left'
|
|
25
25
|
},
|
|
26
|
-
children: "
|
|
26
|
+
children: "Heading 6"
|
|
27
27
|
}),
|
|
28
28
|
execute: function execute(state, api) {
|
|
29
|
-
(0, _title.
|
|
29
|
+
(0, _title.headingExecute)({
|
|
30
30
|
state: state,
|
|
31
31
|
api: api,
|
|
32
32
|
prefix: state.command.prefix,
|
|
33
33
|
suffix: state.command.suffix
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `heading6` instead.
|
|
40
|
+
* This command is now deprecated and will be removed in future versions.
|
|
41
|
+
* Use `title6` for inserting Heading 6.
|
|
42
|
+
*/
|
|
43
|
+
var title6 = exports.title6 = heading6;
|
package/lib/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';
|
package/lib/index.js
CHANGED
|
@@ -6,9 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
var _exportNames = {
|
|
8
8
|
commands: true,
|
|
9
|
-
MarkdownUtil: true
|
|
9
|
+
MarkdownUtil: true,
|
|
10
|
+
headingExecute: true
|
|
10
11
|
};
|
|
11
12
|
exports["default"] = exports.commands = exports.MarkdownUtil = void 0;
|
|
13
|
+
Object.defineProperty(exports, "headingExecute", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _title.headingExecute;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
12
19
|
var _Editor = _interopRequireWildcard(require("./Editor"));
|
|
13
20
|
Object.keys(_Editor).forEach(function (key) {
|
|
14
21
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -47,6 +54,7 @@ Object.keys(MarkdownUtil).forEach(function (key) {
|
|
|
47
54
|
}
|
|
48
55
|
});
|
|
49
56
|
});
|
|
57
|
+
var _title = require("./commands/title");
|
|
50
58
|
var _group = require("./commands/group");
|
|
51
59
|
Object.keys(_group).forEach(function (key) {
|
|
52
60
|
if (key === "default" || key === "__esModule") return;
|
package/markdown-editor.css
CHANGED
package/nohighlight.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ declare module '@uiw/react-md-editor/nohighlight' {
|
|
|
2
2
|
import MDEditor from '@uiw/react-md-editor/esm/Editor.nohighlight';
|
|
3
3
|
import * as commands from '@uiw/react-md-editor/esm/commands';
|
|
4
4
|
import * as MarkdownUtil from '@uiw/react-md-editor/esm/utils/markdownUtils';
|
|
5
|
+
export { headingExecute } from '@uiw/react-md-editor/esm/commands/title';
|
|
5
6
|
export * from '@uiw/react-md-editor/esm/commands';
|
|
6
7
|
export * from '@uiw/react-md-editor/esm/commands/group';
|
|
7
8
|
export * from '@uiw/react-md-editor/esm/utils/markdownUtils';
|
|
8
9
|
export * from '@uiw/react-md-editor/esm/utils/InsertTextAtPosition';
|
|
9
10
|
export * from '@uiw/react-md-editor/esm/Editor.nohighlight';
|
|
10
11
|
export * from '@uiw/react-md-editor/esm/Context';
|
|
12
|
+
export * from '@uiw/react-md-editor/esm/Types';
|
|
11
13
|
export { MarkdownUtil, commands };
|
|
12
14
|
export default MDEditor;
|
|
13
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uiw/react-md-editor",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "A markdown editor with preview, implemented with React.js and TypeScript.",
|
|
5
5
|
"homepage": "https://uiwjs.github.io/react-md-editor/",
|
|
6
6
|
"funding": "https://jaywcjlove.github.io/#/sponsor",
|
package/src/commands/index.cn.ts
CHANGED
|
@@ -46,7 +46,7 @@ let fullscreen: ICommand = {
|
|
|
46
46
|
...fullscreenInit,
|
|
47
47
|
buttonProps: { 'aria-label': '切换全屏(ctrl + 0)', title: '切换全屏(ctrl + 0)' },
|
|
48
48
|
};
|
|
49
|
-
let hr: ICommand = { ...hrInit, buttonProps: { 'aria-label': '
|
|
49
|
+
let hr: ICommand = { ...hrInit, buttonProps: { 'aria-label': '插入分割线 (ctrl + h)', title: '插入分割线 (ctrl + h)' } };
|
|
50
50
|
let image: ICommand = {
|
|
51
51
|
...imageInit,
|
|
52
52
|
buttonProps: { 'aria-label': '添加图像(ctrl + k)', title: '添加图像(ctrl + k)' },
|
|
@@ -91,8 +91,8 @@ let quote: ICommand = {
|
|
|
91
91
|
let strikethrough: ICommand = {
|
|
92
92
|
...strikethroughInit,
|
|
93
93
|
buttonProps: {
|
|
94
|
-
'aria-label': '
|
|
95
|
-
title: '
|
|
94
|
+
'aria-label': '添加删除线文本 (ctrl + shift + x)',
|
|
95
|
+
title: '添加删除线文本 (ctrl + shift + x)',
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
98
|
let issue: ICommand = { ...issueInit, buttonProps: { 'aria-label': '添加 issue', title: '添加 issue' } };
|
package/src/commands/index.ts
CHANGED
|
@@ -15,13 +15,13 @@ import { checkedListCommand, orderedListCommand, unorderedListCommand } from './
|
|
|
15
15
|
import { codeEdit, codeLive, codePreview } from './preview';
|
|
16
16
|
import { quote } from './quote';
|
|
17
17
|
import { strikethrough } from './strikeThrough';
|
|
18
|
-
import { title } from './title';
|
|
19
|
-
import { title1 } from './title1';
|
|
20
|
-
import { title2 } from './title2';
|
|
21
|
-
import { title3 } from './title3';
|
|
22
|
-
import { title4 } from './title4';
|
|
23
|
-
import { title5 } from './title5';
|
|
24
|
-
import { title6 } from './title6';
|
|
18
|
+
import { title, heading } from './title';
|
|
19
|
+
import { title1, heading1 } from './title1';
|
|
20
|
+
import { title2, heading2 } from './title2';
|
|
21
|
+
import { title3, heading3 } from './title3';
|
|
22
|
+
import { title4, heading4 } from './title4';
|
|
23
|
+
import { title5, heading5 } from './title5';
|
|
24
|
+
import { title6, heading6 } from './title6';
|
|
25
25
|
import { table } from './table';
|
|
26
26
|
import { issue } from './issue';
|
|
27
27
|
import { help } from './help';
|
|
@@ -188,6 +188,13 @@ export {
|
|
|
188
188
|
title4,
|
|
189
189
|
title5,
|
|
190
190
|
title6,
|
|
191
|
+
heading,
|
|
192
|
+
heading1,
|
|
193
|
+
heading2,
|
|
194
|
+
heading3,
|
|
195
|
+
heading4,
|
|
196
|
+
heading5,
|
|
197
|
+
heading6,
|
|
191
198
|
bold,
|
|
192
199
|
codeBlock,
|
|
193
200
|
comment,
|
package/src/commands/title.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ICommand, ExecuteState, TextAreaTextApi } from './';
|
|
3
|
-
import {
|
|
3
|
+
import { heading1 } from './title1';
|
|
4
4
|
import { selectLine, executeCommand } from '../utils/markdownUtils';
|
|
5
5
|
|
|
6
|
-
export function
|
|
6
|
+
export function headingExecute({
|
|
7
7
|
state,
|
|
8
8
|
api,
|
|
9
9
|
prefix,
|
|
@@ -19,8 +19,8 @@ export function titleExecute({
|
|
|
19
19
|
executeCommand({ api, selectedText: state1.selectedText, selection: state.selection, prefix, suffix });
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export const
|
|
23
|
-
...
|
|
22
|
+
export const heading: ICommand = {
|
|
23
|
+
...heading1,
|
|
24
24
|
icon: (
|
|
25
25
|
<svg width="12" height="12" viewBox="0 0 520 520">
|
|
26
26
|
<path
|
|
@@ -30,3 +30,10 @@ export const title: ICommand = {
|
|
|
30
30
|
</svg>
|
|
31
31
|
),
|
|
32
32
|
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use `heading` instead.
|
|
36
|
+
* This command is now deprecated and will be removed in future versions.
|
|
37
|
+
* Use `title` for inserting headings.
|
|
38
|
+
*/
|
|
39
|
+
export const title: ICommand = heading;
|
package/src/commands/title1.tsx
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from '../commands/title';
|
|
3
3
|
import { ICommand, ExecuteState, TextAreaTextApi } from './';
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
name: '
|
|
7
|
-
keyCommand: '
|
|
5
|
+
export const heading1: ICommand = {
|
|
6
|
+
name: 'heading1',
|
|
7
|
+
keyCommand: 'heading1',
|
|
8
8
|
shortcuts: 'ctrlcmd+1',
|
|
9
9
|
prefix: '# ',
|
|
10
10
|
suffix: '',
|
|
11
|
-
buttonProps: { 'aria-label': 'Insert
|
|
12
|
-
icon: <div style={{ fontSize: 18, textAlign: 'left' }}>
|
|
11
|
+
buttonProps: { 'aria-label': 'Insert Heading 1 (ctrl + 1)', title: 'Insert Heading 1 (ctrl + 1)' },
|
|
12
|
+
icon: <div style={{ fontSize: 18, textAlign: 'left' }}>Heading 1</div>,
|
|
13
13
|
execute: (state: ExecuteState, api: TextAreaTextApi) => {
|
|
14
|
-
|
|
14
|
+
headingExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `heading1` instead.
|
|
20
|
+
* This command is now deprecated and will be removed in future versions.
|
|
21
|
+
* Use `title1` for inserting Heading 1.
|
|
22
|
+
*/
|
|
23
|
+
export const title1: ICommand = heading1;
|
package/src/commands/title2.tsx
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from '../commands/title';
|
|
3
3
|
import { ICommand, ExecuteState, TextAreaTextApi } from './';
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
name: '
|
|
7
|
-
keyCommand: '
|
|
5
|
+
export const heading2: ICommand = {
|
|
6
|
+
name: 'heading2',
|
|
7
|
+
keyCommand: 'heading2',
|
|
8
8
|
shortcuts: 'ctrlcmd+2',
|
|
9
9
|
prefix: '## ',
|
|
10
10
|
suffix: '',
|
|
11
|
-
buttonProps: { 'aria-label': 'Insert
|
|
12
|
-
icon: <div style={{ fontSize: 16, textAlign: 'left' }}>
|
|
11
|
+
buttonProps: { 'aria-label': 'Insert Heading 2 (ctrl + 2)', title: 'Insert Heading 2 (ctrl + 2)' },
|
|
12
|
+
icon: <div style={{ fontSize: 16, textAlign: 'left' }}>Heading 2</div>,
|
|
13
13
|
execute: (state: ExecuteState, api: TextAreaTextApi) => {
|
|
14
|
-
|
|
14
|
+
headingExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `heading2` instead.
|
|
20
|
+
* This command is now deprecated and will be removed in future versions.
|
|
21
|
+
* Use `title2` for inserting Heading 2.
|
|
22
|
+
*/
|
|
23
|
+
export const title2: ICommand = heading2;
|
package/src/commands/title3.tsx
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from '../commands/title';
|
|
3
3
|
import { ICommand, ExecuteState, TextAreaTextApi } from './';
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
name: '
|
|
7
|
-
keyCommand: '
|
|
5
|
+
export const heading3: ICommand = {
|
|
6
|
+
name: 'heading3',
|
|
7
|
+
keyCommand: 'heading3',
|
|
8
8
|
shortcuts: 'ctrlcmd+3',
|
|
9
9
|
prefix: '### ',
|
|
10
10
|
suffix: '',
|
|
11
|
-
buttonProps: { 'aria-label': 'Insert
|
|
12
|
-
icon: <div style={{ fontSize: 15, textAlign: 'left' }}>
|
|
11
|
+
buttonProps: { 'aria-label': 'Insert Heading 3 (ctrl + 3)', title: 'Insert Heading 3 (ctrl + 3)' },
|
|
12
|
+
icon: <div style={{ fontSize: 15, textAlign: 'left' }}>Heading 3</div>,
|
|
13
13
|
execute: (state: ExecuteState, api: TextAreaTextApi) => {
|
|
14
|
-
|
|
14
|
+
headingExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `heading3` instead.
|
|
20
|
+
* This command is now deprecated and will be removed in future versions.
|
|
21
|
+
* Use `title3` for inserting Heading 3.
|
|
22
|
+
*/
|
|
23
|
+
export const title3: ICommand = heading3;
|
package/src/commands/title4.tsx
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { headingExecute } from '../commands/title';
|
|
3
3
|
import { ICommand, ExecuteState, TextAreaTextApi } from './';
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
name: '
|
|
7
|
-
keyCommand: '
|
|
5
|
+
export const heading4: ICommand = {
|
|
6
|
+
name: 'heading4',
|
|
7
|
+
keyCommand: 'heading4',
|
|
8
8
|
shortcuts: 'ctrlcmd+4',
|
|
9
9
|
prefix: '#### ',
|
|
10
10
|
suffix: '',
|
|
11
|
-
buttonProps: { 'aria-label': 'Insert
|
|
12
|
-
icon: <div style={{ fontSize: 14, textAlign: 'left' }}>
|
|
11
|
+
buttonProps: { 'aria-label': 'Insert Heading 4 (ctrl + 4)', title: 'Insert Heading 4 (ctrl + 4)' },
|
|
12
|
+
icon: <div style={{ fontSize: 14, textAlign: 'left' }}>Heading 4</div>,
|
|
13
13
|
execute: (state: ExecuteState, api: TextAreaTextApi) => {
|
|
14
|
-
|
|
14
|
+
headingExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `heading4` instead.
|
|
20
|
+
* This command is now deprecated and will be removed in future versions.
|
|
21
|
+
* Use `title4` for inserting Heading 4.
|
|
22
|
+
*/
|
|
23
|
+
export const title4: ICommand = heading4;
|