@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.
Files changed (82) hide show
  1. package/README.md +104 -2
  2. package/commands.d.ts +14 -7
  3. package/dist/mdeditor.css +1 -1
  4. package/dist/mdeditor.js +231 -233
  5. package/dist/mdeditor.min.js +1 -1
  6. package/esm/Editor.d.ts +1 -1
  7. package/esm/Editor.nohighlight.d.ts +1 -1
  8. package/esm/commands/index.cn.js +4 -4
  9. package/esm/commands/index.d.ts +8 -8
  10. package/esm/commands/index.js +8 -8
  11. package/esm/commands/title.d.ts +7 -1
  12. package/esm/commands/title.js +11 -4
  13. package/esm/commands/title1.d.ts +6 -0
  14. package/esm/commands/title1.js +16 -9
  15. package/esm/commands/title2.d.ts +6 -0
  16. package/esm/commands/title2.js +16 -9
  17. package/esm/commands/title3.d.ts +6 -0
  18. package/esm/commands/title3.js +16 -9
  19. package/esm/commands/title4.d.ts +6 -0
  20. package/esm/commands/title4.js +16 -9
  21. package/esm/commands/title5.d.ts +6 -0
  22. package/esm/commands/title5.js +16 -9
  23. package/esm/commands/title6.d.ts +6 -0
  24. package/esm/commands/title6.js +16 -9
  25. package/esm/components/DragBar/index.d.ts +1 -1
  26. package/esm/components/TextArea/Markdown.d.ts +1 -1
  27. package/esm/components/TextArea/Textarea.d.ts +1 -1
  28. package/esm/components/TextArea/index.d.ts +4 -4
  29. package/esm/components/TextArea/index.nohighlight.d.ts +3 -3
  30. package/esm/components/Toolbar/Child.d.ts +1 -1
  31. package/esm/components/Toolbar/index.d.ts +1 -1
  32. package/esm/index.d.ts +3 -0
  33. package/esm/index.js +3 -0
  34. package/lib/Editor.d.ts +1 -1
  35. package/lib/Editor.nohighlight.d.ts +1 -1
  36. package/lib/commands/index.cn.js +4 -4
  37. package/lib/commands/index.d.ts +8 -8
  38. package/lib/commands/index.js +42 -0
  39. package/lib/commands/title.d.ts +7 -1
  40. package/lib/commands/title.js +12 -4
  41. package/lib/commands/title1.d.ts +6 -0
  42. package/lib/commands/title1.js +16 -9
  43. package/lib/commands/title2.d.ts +6 -0
  44. package/lib/commands/title2.js +16 -9
  45. package/lib/commands/title3.d.ts +6 -0
  46. package/lib/commands/title3.js +16 -9
  47. package/lib/commands/title4.d.ts +6 -0
  48. package/lib/commands/title4.js +16 -9
  49. package/lib/commands/title5.d.ts +6 -0
  50. package/lib/commands/title5.js +16 -9
  51. package/lib/commands/title6.d.ts +6 -0
  52. package/lib/commands/title6.js +16 -9
  53. package/lib/components/DragBar/index.d.ts +1 -1
  54. package/lib/components/TextArea/Markdown.d.ts +1 -1
  55. package/lib/components/TextArea/Textarea.d.ts +1 -1
  56. package/lib/components/TextArea/index.d.ts +4 -4
  57. package/lib/components/TextArea/index.nohighlight.d.ts +3 -3
  58. package/lib/components/Toolbar/Child.d.ts +1 -1
  59. package/lib/components/Toolbar/index.d.ts +1 -1
  60. package/lib/index.d.ts +3 -0
  61. package/lib/index.js +26 -1
  62. package/nohighlight.d.ts +2 -0
  63. package/package.json +1 -1
  64. package/src/Editor.nohighlight.tsx +2 -2
  65. package/src/Editor.tsx +3 -3
  66. package/src/commands/index.cn.ts +3 -3
  67. package/src/commands/index.ts +14 -7
  68. package/src/commands/title.tsx +11 -4
  69. package/src/commands/title1.tsx +14 -7
  70. package/src/commands/title2.tsx +14 -7
  71. package/src/commands/title3.tsx +14 -7
  72. package/src/commands/title4.tsx +14 -7
  73. package/src/commands/title5.tsx +14 -7
  74. package/src/commands/title6.tsx +14 -7
  75. package/src/components/DragBar/index.tsx +1 -1
  76. package/src/components/TextArea/Markdown.tsx +1 -1
  77. package/src/components/TextArea/Textarea.tsx +2 -2
  78. package/src/components/TextArea/index.nohighlight.tsx +5 -4
  79. package/src/components/TextArea/index.tsx +6 -5
  80. package/src/components/Toolbar/Child.tsx +1 -1
  81. package/src/components/Toolbar/index.tsx +2 -2
  82. package/src/index.tsx +3 -0
@@ -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, };
@@ -73,6 +73,48 @@ Object.defineProperty(exports, "group", {
73
73
  return _group.group;
74
74
  }
75
75
  });
76
+ Object.defineProperty(exports, "heading", {
77
+ enumerable: true,
78
+ get: function get() {
79
+ return _title.heading;
80
+ }
81
+ });
82
+ Object.defineProperty(exports, "heading1", {
83
+ enumerable: true,
84
+ get: function get() {
85
+ return _title2.heading1;
86
+ }
87
+ });
88
+ Object.defineProperty(exports, "heading2", {
89
+ enumerable: true,
90
+ get: function get() {
91
+ return _title3.heading2;
92
+ }
93
+ });
94
+ Object.defineProperty(exports, "heading3", {
95
+ enumerable: true,
96
+ get: function get() {
97
+ return _title4.heading3;
98
+ }
99
+ });
100
+ Object.defineProperty(exports, "heading4", {
101
+ enumerable: true,
102
+ get: function get() {
103
+ return _title5.heading4;
104
+ }
105
+ });
106
+ Object.defineProperty(exports, "heading5", {
107
+ enumerable: true,
108
+ get: function get() {
109
+ return _title6.heading5;
110
+ }
111
+ });
112
+ Object.defineProperty(exports, "heading6", {
113
+ enumerable: true,
114
+ get: function get() {
115
+ return _title7.heading6;
116
+ }
117
+ });
76
118
  Object.defineProperty(exports, "help", {
77
119
  enumerable: true,
78
120
  get: function get() {
@@ -1,8 +1,14 @@
1
1
  import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
- export declare function titleExecute({ state, api, prefix, suffix, }: {
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;
@@ -4,14 +4,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.heading = void 0;
8
+ exports.headingExecute = headingExecute;
7
9
  exports.title = void 0;
8
- exports.titleExecute = titleExecute;
9
10
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
11
  var _react = _interopRequireDefault(require("react"));
11
12
  var _title = require("./title1");
12
13
  var _markdownUtils = require("../utils/markdownUtils");
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
- function titleExecute(_ref) {
15
+ function headingExecute(_ref) {
15
16
  var state = _ref.state,
16
17
  api = _ref.api,
17
18
  prefix = _ref.prefix,
@@ -30,7 +31,7 @@ function titleExecute(_ref) {
30
31
  suffix: suffix
31
32
  });
32
33
  }
33
- var title = exports.title = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _title.title1), {}, {
34
+ var heading = exports.heading = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _title.heading1), {}, {
34
35
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
35
36
  width: "12",
36
37
  height: "12",
@@ -40,4 +41,11 @@ var title = exports.title = (0, _objectSpread2["default"])((0, _objectSpread2["d
40
41
  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"
41
42
  })
42
43
  })
43
- });
44
+ });
45
+
46
+ /**
47
+ * @deprecated Use `heading` instead.
48
+ * This command is now deprecated and will be removed in future versions.
49
+ * Use `title` for inserting headings.
50
+ */
51
+ var title = exports.title = heading;
@@ -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;
@@ -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 title1 = exports.title1 = {
12
- name: 'title1',
13
- keyCommand: 'title1',
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 title1 (ctrl + 1)',
19
- title: 'Insert title1 (ctrl + 1)'
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: "Title 1"
26
+ children: "Heading 1"
27
27
  }),
28
28
  execute: function execute(state, api) {
29
- (0, _title.titleExecute)({
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;
@@ -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;
@@ -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 title2 = exports.title2 = {
12
- name: 'title2',
13
- keyCommand: 'title2',
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 title2 (ctrl + 2)',
19
- title: 'Insert title2 (ctrl + 2)'
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: "Title 2"
26
+ children: "Heading 2"
27
27
  }),
28
28
  execute: function execute(state, api) {
29
- (0, _title.titleExecute)({
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;
@@ -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;
@@ -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 title3 = exports.title3 = {
12
- name: 'title3',
13
- keyCommand: 'title3',
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 title3 (ctrl + 3)',
19
- title: 'Insert title3 (ctrl + 3)'
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: "Title 3"
26
+ children: "Heading 3"
27
27
  }),
28
28
  execute: function execute(state, api) {
29
- (0, _title.titleExecute)({
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;
@@ -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;
@@ -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 title4 = exports.title4 = {
12
- name: 'title4',
13
- keyCommand: 'title4',
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 title4 (ctrl + 4)',
19
- title: 'Insert title4 (ctrl + 4)'
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: "Title 4"
26
+ children: "Heading 4"
27
27
  }),
28
28
  execute: function execute(state, api) {
29
- (0, _title.titleExecute)({
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;
@@ -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;
@@ -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 title5 = exports.title5 = {
12
- name: 'title5',
13
- keyCommand: 'title5',
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 title5 (ctrl + 5)',
19
- title: 'Insert title5 (ctrl + 5)'
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: "Title 5"
26
+ children: "Heading 5"
27
27
  }),
28
28
  execute: function execute(state, api) {
29
- (0, _title.titleExecute)({
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;
@@ -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;
@@ -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 title6 = exports.title6 = {
12
- name: 'title6',
13
- keyCommand: 'title6',
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 title6 (ctrl + 6)',
19
- title: 'Insert title6 (ctrl + 6)'
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: "Title 6"
26
+ children: "Heading 6"
27
27
  }),
28
28
  execute: function execute(state, api) {
29
- (0, _title.titleExecute)({
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;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IProps } from '../../Types';
2
+ import { type IProps } from '../../Types';
3
3
  import './index.less';
4
4
  export interface IDragBarProps extends IProps {
5
5
  height: number;
@@ -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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IProps } from '../../Types';
2
+ import { type IProps } from '../../Types';
3
3
  import './index.less';
4
4
  export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value'>, IProps {
5
5
  }
@@ -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'];
@@ -1,4 +1,4 @@
1
- import { JSX } from 'react';
1
+ import { type JSX } from 'react';
2
2
  import './Child.less';
3
3
  import { type IToolbarProps } from './';
4
4
  export type ChildProps = IToolbarProps & {
@@ -1,4 +1,4 @@
1
- import { IProps } from '../../Types';
1
+ import { type IProps } from '../../Types';
2
2
  import { ICommand } from '../../commands/';
3
3
  import './index.less';
4
4
  export interface IToolbarProps extends IProps {
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';
@@ -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/lib/index.js CHANGED
@@ -1,14 +1,36 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  var _exportNames = {
8
9
  commands: true,
9
- MarkdownUtil: true
10
+ MarkdownUtil: true,
11
+ headingExecute: true,
12
+ handleKeyDown: true,
13
+ shortcuts: true
10
14
  };
11
15
  exports["default"] = exports.commands = exports.MarkdownUtil = void 0;
16
+ Object.defineProperty(exports, "handleKeyDown", {
17
+ enumerable: true,
18
+ get: function get() {
19
+ return _handleKeyDown["default"];
20
+ }
21
+ });
22
+ Object.defineProperty(exports, "headingExecute", {
23
+ enumerable: true,
24
+ get: function get() {
25
+ return _title.headingExecute;
26
+ }
27
+ });
28
+ Object.defineProperty(exports, "shortcuts", {
29
+ enumerable: true,
30
+ get: function get() {
31
+ return _shortcuts["default"];
32
+ }
33
+ });
12
34
  var _Editor = _interopRequireWildcard(require("./Editor"));
13
35
  Object.keys(_Editor).forEach(function (key) {
14
36
  if (key === "default" || key === "__esModule") return;
@@ -47,6 +69,7 @@ Object.keys(MarkdownUtil).forEach(function (key) {
47
69
  }
48
70
  });
49
71
  });
72
+ var _title = require("./commands/title");
50
73
  var _group = require("./commands/group");
51
74
  Object.keys(_group).forEach(function (key) {
52
75
  if (key === "default" || key === "__esModule") return;
@@ -95,4 +118,6 @@ Object.keys(_Types).forEach(function (key) {
95
118
  }
96
119
  });
97
120
  });
121
+ var _handleKeyDown = _interopRequireDefault(require("./components/TextArea/handleKeyDown"));
122
+ var _shortcuts = _interopRequireDefault(require("./components/TextArea/shortcuts"));
98
123
  var _default = exports["default"] = _Editor["default"];
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.7",
3
+ "version": "4.0.9",
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",