@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.
Files changed (56) hide show
  1. package/README.md +36 -1
  2. package/commands.d.ts +14 -7
  3. package/dist/mdeditor.js +53 -11
  4. package/dist/mdeditor.min.js +1 -1
  5. package/esm/commands/index.cn.js +4 -4
  6. package/esm/commands/index.d.ts +8 -8
  7. package/esm/commands/index.js +8 -8
  8. package/esm/commands/title.d.ts +7 -1
  9. package/esm/commands/title.js +11 -4
  10. package/esm/commands/title1.d.ts +6 -0
  11. package/esm/commands/title1.js +16 -9
  12. package/esm/commands/title2.d.ts +6 -0
  13. package/esm/commands/title2.js +16 -9
  14. package/esm/commands/title3.d.ts +6 -0
  15. package/esm/commands/title3.js +16 -9
  16. package/esm/commands/title4.d.ts +6 -0
  17. package/esm/commands/title4.js +16 -9
  18. package/esm/commands/title5.d.ts +6 -0
  19. package/esm/commands/title5.js +16 -9
  20. package/esm/commands/title6.d.ts +6 -0
  21. package/esm/commands/title6.js +16 -9
  22. package/esm/index.css +0 -1
  23. package/esm/index.d.ts +1 -0
  24. package/esm/index.js +1 -0
  25. package/lib/commands/index.cn.js +4 -4
  26. package/lib/commands/index.d.ts +8 -8
  27. package/lib/commands/index.js +42 -0
  28. package/lib/commands/title.d.ts +7 -1
  29. package/lib/commands/title.js +12 -4
  30. package/lib/commands/title1.d.ts +6 -0
  31. package/lib/commands/title1.js +16 -9
  32. package/lib/commands/title2.d.ts +6 -0
  33. package/lib/commands/title2.js +16 -9
  34. package/lib/commands/title3.d.ts +6 -0
  35. package/lib/commands/title3.js +16 -9
  36. package/lib/commands/title4.d.ts +6 -0
  37. package/lib/commands/title4.js +16 -9
  38. package/lib/commands/title5.d.ts +6 -0
  39. package/lib/commands/title5.js +16 -9
  40. package/lib/commands/title6.d.ts +6 -0
  41. package/lib/commands/title6.js +16 -9
  42. package/lib/index.d.ts +1 -0
  43. package/lib/index.js +9 -1
  44. package/markdown-editor.css +0 -1
  45. package/nohighlight.d.ts +2 -0
  46. package/package.json +1 -1
  47. package/src/commands/index.cn.ts +3 -3
  48. package/src/commands/index.ts +14 -7
  49. package/src/commands/title.tsx +11 -4
  50. package/src/commands/title1.tsx +14 -7
  51. package/src/commands/title2.tsx +14 -7
  52. package/src/commands/title3.tsx +14 -7
  53. package/src/commands/title4.tsx +14 -7
  54. package/src/commands/title5.tsx +14 -7
  55. package/src/commands/title6.tsx +14 -7
  56. package/src/index.tsx +1 -0
@@ -1,16 +1,23 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { headingExecute } from '../commands/title';
3
3
  import { ICommand, ExecuteState, TextAreaTextApi } from './';
4
4
 
5
- export const title5: ICommand = {
6
- name: 'title5',
7
- keyCommand: 'title5',
5
+ export const heading5: ICommand = {
6
+ name: 'heading5',
7
+ keyCommand: 'heading5',
8
8
  shortcuts: 'ctrlcmd+5',
9
9
  prefix: '##### ',
10
10
  suffix: '',
11
- buttonProps: { 'aria-label': 'Insert title5 (ctrl + 5)', title: 'Insert title5 (ctrl + 5)' },
12
- icon: <div style={{ fontSize: 12, textAlign: 'left' }}>Title 5</div>,
11
+ buttonProps: { 'aria-label': 'Insert Heading 5 (ctrl + 5)', title: 'Insert Heading 5 (ctrl + 5)' },
12
+ icon: <div style={{ fontSize: 12, textAlign: 'left' }}>Heading 5</div>,
13
13
  execute: (state: ExecuteState, api: TextAreaTextApi) => {
14
- titleExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
14
+ headingExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
15
15
  },
16
16
  };
17
+
18
+ /**
19
+ * @deprecated Use `heading5` instead.
20
+ * This command is now deprecated and will be removed in future versions.
21
+ * Use `title5` for inserting Heading 5.
22
+ */
23
+ export const title5: ICommand = heading5;
@@ -1,16 +1,23 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { headingExecute } from '../commands/title';
3
3
  import { ICommand, ExecuteState, TextAreaTextApi } from './';
4
4
 
5
- export const title6: ICommand = {
6
- name: 'title6',
7
- keyCommand: 'title6',
5
+ export const heading6: ICommand = {
6
+ name: 'heading6',
7
+ keyCommand: 'heading6',
8
8
  shortcuts: 'ctrlcmd+6',
9
9
  prefix: '###### ',
10
10
  suffix: '',
11
- buttonProps: { 'aria-label': 'Insert title6 (ctrl + 6)', title: 'Insert title6 (ctrl + 6)' },
12
- icon: <div style={{ fontSize: 12, textAlign: 'left' }}>Title 6</div>,
11
+ buttonProps: { 'aria-label': 'Insert Heading 6 (ctrl + 6)', title: 'Insert Heading 6 (ctrl + 6)' },
12
+ icon: <div style={{ fontSize: 12, textAlign: 'left' }}>Heading 6</div>,
13
13
  execute: (state: ExecuteState, api: TextAreaTextApi) => {
14
- titleExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
14
+ headingExecute({ state, api, prefix: state.command.prefix!, suffix: state.command.suffix });
15
15
  },
16
16
  };
17
+
18
+ /**
19
+ * @deprecated Use `heading6` instead.
20
+ * This command is now deprecated and will be removed in future versions.
21
+ * Use `title6` for inserting Heading 6.
22
+ */
23
+ export const title6: ICommand = heading6;
package/src/index.tsx CHANGED
@@ -3,6 +3,7 @@ import * as commands from './commands/';
3
3
  import * as MarkdownUtil from './utils/markdownUtils';
4
4
  import './index.less';
5
5
 
6
+ export { headingExecute } from './commands/title';
6
7
  export * from './commands/';
7
8
  export * from './commands/group';
8
9
  export * from './utils/markdownUtils';