@uiw/react-md-editor 4.0.4 → 4.0.6

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 (136) hide show
  1. package/README.md +81 -76
  2. package/dist/mdeditor.css +193 -109
  3. package/dist/mdeditor.js +69395 -66037
  4. package/dist/mdeditor.min.css +1 -1
  5. package/dist/mdeditor.min.js +1 -1
  6. package/dist/mdeditor.min.js.LICENSE.txt +2 -2
  7. package/esm/Context.d.ts +21 -34
  8. package/esm/Editor.js +6 -7
  9. package/esm/Editor.nohighlight.js +5 -6
  10. package/esm/Types.d.ts +1 -1
  11. package/esm/commands/bold.d.ts +1 -1
  12. package/esm/commands/bold.js +1 -1
  13. package/esm/commands/code.d.ts +1 -1
  14. package/esm/commands/code.js +1 -1
  15. package/esm/commands/comment.d.ts +1 -1
  16. package/esm/commands/comment.js +2 -3
  17. package/esm/commands/divider.d.ts +1 -1
  18. package/esm/commands/fullscreen.d.ts +1 -1
  19. package/esm/commands/group.d.ts +2 -2
  20. package/esm/commands/help.d.ts +1 -1
  21. package/esm/commands/hr.d.ts +1 -1
  22. package/esm/commands/hr.js +1 -1
  23. package/esm/commands/image.d.ts +1 -1
  24. package/esm/commands/image.js +1 -1
  25. package/esm/commands/index.cn.js +24 -24
  26. package/esm/commands/index.d.ts +1 -1
  27. package/esm/commands/index.js +25 -25
  28. package/esm/commands/issue.d.ts +1 -1
  29. package/esm/commands/issue.js +3 -3
  30. package/esm/commands/italic.d.ts +1 -1
  31. package/esm/commands/italic.js +1 -1
  32. package/esm/commands/link.d.ts +1 -1
  33. package/esm/commands/link.js +1 -1
  34. package/esm/commands/list.d.ts +1 -1
  35. package/esm/commands/list.js +1 -1
  36. package/esm/commands/preview.d.ts +1 -1
  37. package/esm/commands/preview.js +1 -2
  38. package/esm/commands/quote.d.ts +1 -1
  39. package/esm/commands/quote.js +1 -1
  40. package/esm/commands/strikeThrough.js +1 -1
  41. package/esm/commands/table.js +1 -1
  42. package/esm/commands/title.js +2 -2
  43. package/esm/commands/title1.js +1 -1
  44. package/esm/commands/title2.js +1 -1
  45. package/esm/commands/title3.js +1 -1
  46. package/esm/commands/title4.js +1 -1
  47. package/esm/commands/title5.js +1 -1
  48. package/esm/commands/title6.js +1 -1
  49. package/esm/components/TextArea/Markdown.js +1 -1
  50. package/esm/components/TextArea/Textarea.js +4 -4
  51. package/esm/components/TextArea/handleKeyDown.d.ts +0 -1
  52. package/esm/components/TextArea/handleKeyDown.js +3 -4
  53. package/esm/components/TextArea/index.d.ts +2 -2
  54. package/esm/components/TextArea/index.js +10 -11
  55. package/esm/components/TextArea/index.nohighlight.d.ts +2 -2
  56. package/esm/components/TextArea/index.nohighlight.js +8 -8
  57. package/esm/components/TextArea/shortcuts.d.ts +1 -2
  58. package/esm/components/Toolbar/Child.d.ts +1 -1
  59. package/esm/components/Toolbar/Child.js +2 -2
  60. package/esm/components/Toolbar/index.d.ts +1 -1
  61. package/esm/components/Toolbar/index.js +3 -4
  62. package/esm/index.css +0 -1
  63. package/esm/index.d.ts +2 -2
  64. package/esm/index.js +10 -10
  65. package/esm/index.nohighlight.d.ts +2 -2
  66. package/esm/index.nohighlight.js +8 -8
  67. package/esm/utils/markdownUtils.d.ts +1 -2
  68. package/lib/Context.d.ts +21 -34
  69. package/lib/Editor.js +4 -4
  70. package/lib/Editor.nohighlight.js +3 -3
  71. package/lib/Types.d.ts +1 -1
  72. package/lib/commands/bold.d.ts +1 -1
  73. package/lib/commands/code.d.ts +1 -1
  74. package/lib/commands/comment.d.ts +1 -1
  75. package/lib/commands/divider.d.ts +1 -1
  76. package/lib/commands/fullscreen.d.ts +1 -1
  77. package/lib/commands/group.d.ts +2 -2
  78. package/lib/commands/help.d.ts +1 -1
  79. package/lib/commands/hr.d.ts +1 -1
  80. package/lib/commands/image.d.ts +1 -1
  81. package/lib/commands/index.d.ts +1 -1
  82. package/lib/commands/index.js +2 -4
  83. package/lib/commands/issue.d.ts +1 -1
  84. package/lib/commands/issue.js +2 -2
  85. package/lib/commands/italic.d.ts +1 -1
  86. package/lib/commands/link.d.ts +1 -1
  87. package/lib/commands/list.d.ts +1 -1
  88. package/lib/commands/preview.d.ts +1 -1
  89. package/lib/commands/quote.d.ts +1 -1
  90. package/lib/components/TextArea/Textarea.js +1 -1
  91. package/lib/components/TextArea/handleKeyDown.d.ts +0 -1
  92. package/lib/components/TextArea/handleKeyDown.js +1 -1
  93. package/lib/components/TextArea/index.d.ts +2 -2
  94. package/lib/components/TextArea/index.js +5 -5
  95. package/lib/components/TextArea/index.nohighlight.d.ts +2 -2
  96. package/lib/components/TextArea/index.nohighlight.js +5 -5
  97. package/lib/components/TextArea/shortcuts.d.ts +1 -2
  98. package/lib/components/Toolbar/Child.d.ts +1 -1
  99. package/lib/components/Toolbar/index.d.ts +1 -1
  100. package/lib/index.d.ts +2 -2
  101. package/lib/index.js +1 -1
  102. package/lib/index.nohighlight.d.ts +2 -2
  103. package/lib/index.nohighlight.js +1 -1
  104. package/lib/utils/markdownUtils.d.ts +1 -2
  105. package/markdown-editor.css +0 -1
  106. package/package.json +1 -1
  107. package/src/Context.tsx +1 -1
  108. package/src/Editor.nohighlight.tsx +3 -3
  109. package/src/Editor.tsx +4 -4
  110. package/src/Types.ts +1 -1
  111. package/src/commands/bold.tsx +1 -1
  112. package/src/commands/code.tsx +1 -1
  113. package/src/commands/comment.tsx +1 -1
  114. package/src/commands/divider.tsx +1 -1
  115. package/src/commands/fullscreen.tsx +2 -2
  116. package/src/commands/group.tsx +1 -1
  117. package/src/commands/help.tsx +1 -1
  118. package/src/commands/hr.tsx +1 -1
  119. package/src/commands/image.tsx +1 -1
  120. package/src/commands/index.ts +1 -1
  121. package/src/commands/issue.tsx +3 -3
  122. package/src/commands/italic.tsx +1 -1
  123. package/src/commands/link.tsx +1 -1
  124. package/src/commands/list.tsx +1 -1
  125. package/src/commands/preview.tsx +2 -2
  126. package/src/commands/quote.tsx +1 -1
  127. package/src/components/TextArea/Textarea.tsx +1 -1
  128. package/src/components/TextArea/handleKeyDown.tsx +1 -1
  129. package/src/components/TextArea/index.nohighlight.tsx +2 -2
  130. package/src/components/TextArea/index.tsx +2 -2
  131. package/src/components/TextArea/shortcuts.ts +1 -1
  132. package/src/components/Toolbar/Child.tsx +1 -1
  133. package/src/components/Toolbar/index.tsx +1 -1
  134. package/src/index.nohighlight.tsx +2 -2
  135. package/src/index.tsx +2 -2
  136. package/src/utils/markdownUtils.ts +1 -2
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { JSX } from 'react';
2
2
  import './Child.less';
3
3
  import { type IToolbarProps } from './';
4
4
  export type ChildProps = IToolbarProps & {
@@ -1,5 +1,5 @@
1
1
  import { IProps } from '../../Types';
2
- import { ICommand } from '../../commands';
2
+ import { ICommand } from '../../commands/';
3
3
  import './index.less';
4
4
  export interface IToolbarProps extends IProps {
5
5
  overflow?: boolean;
package/lib/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import MDEditor from './Editor';
2
- import * as commands from './commands';
2
+ import * as commands from './commands/';
3
3
  import * as MarkdownUtil from './utils/markdownUtils';
4
4
  import './index.less';
5
- export * from './commands';
5
+ export * from './commands/';
6
6
  export * from './commands/group';
7
7
  export * from './utils/markdownUtils';
8
8
  export * from './utils/InsertTextAtPosition';
package/lib/index.js CHANGED
@@ -21,7 +21,7 @@ Object.keys(_Editor).forEach(function (key) {
21
21
  }
22
22
  });
23
23
  });
24
- var commands = _interopRequireWildcard(require("./commands"));
24
+ var commands = _interopRequireWildcard(require("./commands/"));
25
25
  exports.commands = commands;
26
26
  Object.keys(commands).forEach(function (key) {
27
27
  if (key === "default" || key === "__esModule") return;
@@ -1,8 +1,8 @@
1
1
  import MDEditor from './Editor.nohighlight';
2
- import * as commands from './commands';
2
+ import * as commands from './commands/';
3
3
  import * as MarkdownUtil from './utils/markdownUtils';
4
4
  import './index.less';
5
- export * from './commands';
5
+ export * from './commands/';
6
6
  export * from './commands/group';
7
7
  export * from './utils/markdownUtils';
8
8
  export * from './utils/InsertTextAtPosition';
@@ -21,7 +21,7 @@ Object.keys(_Editor).forEach(function (key) {
21
21
  }
22
22
  });
23
23
  });
24
- var commands = _interopRequireWildcard(require("./commands"));
24
+ var commands = _interopRequireWildcard(require("./commands/"));
25
25
  exports.commands = commands;
26
26
  Object.keys(commands).forEach(function (key) {
27
27
  if (key === "default" || key === "__esModule") return;
@@ -1,5 +1,4 @@
1
- import { TextRange } from '../commands';
2
- import { TextAreaTextApi } from '../commands';
1
+ import { TextAreaTextApi, type TextRange } from '../commands';
3
2
  export interface TextSection {
4
3
  text: string;
5
4
  selection: TextRange;
@@ -271,7 +271,6 @@
271
271
  text-align: right !important;
272
272
  }
273
273
  .w-md-editor-toolbar {
274
- height: -webkit-fit-content;
275
274
  height: fit-content;
276
275
  }
277
276
  .w-md-editor-content {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uiw/react-md-editor",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
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/Context.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, TextAreaCommandOrchestrator } from './commands';
2
+ import { ICommand, TextAreaCommandOrchestrator } from './commands/';
3
3
  import { MDEditorProps } from './Types';
4
4
 
5
5
  export type PreviewType = 'live' | 'edit' | 'preview';
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect, useReducer, useMemo, useRef, useImperativeHandle } from 'react';
2
2
  import MarkdownPreview from '@uiw/react-markdown-preview/nohighlight';
3
3
  import TextArea from './components/TextArea/index.nohighlight';
4
- import { ToolbarVisibility } from './components/Toolbar';
5
- import DragBar from './components/DragBar';
6
- import { getCommands, getExtraCommands, ICommand, TextState, TextAreaCommandOrchestrator } from './commands';
4
+ import { ToolbarVisibility } from './components/Toolbar/';
5
+ import DragBar from './components/DragBar/';
6
+ import { getCommands, getExtraCommands, ICommand, TextState, TextAreaCommandOrchestrator } from './commands/';
7
7
  import { reducer, EditorContext, ContextStore } from './Context';
8
8
  import type { MDEditorProps } from './Types';
9
9
 
package/src/Editor.tsx CHANGED
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect, useReducer, useMemo, useRef, useImperativeHandle, Fragment } from 'react';
2
2
  import MarkdownPreview from '@uiw/react-markdown-preview';
3
- import TextArea from './components/TextArea';
4
- import { ToolbarVisibility } from './components/Toolbar';
5
- import DragBar from './components/DragBar';
6
- import { getCommands, getExtraCommands, ICommand, TextState, TextAreaCommandOrchestrator } from './commands';
3
+ import { ToolbarVisibility } from './components/Toolbar/';
4
+ import TextArea from './components/TextArea/';
5
+ import DragBar from './components/DragBar/';
6
+ import { getCommands, getExtraCommands, ICommand, TextState, TextAreaCommandOrchestrator } from './commands/';
7
7
  import { reducer, EditorContext, ContextStore } from './Context';
8
8
  import type { MDEditorProps } from './Types';
9
9
 
package/src/Types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CSSProperties } from 'react';
1
+ import type { CSSProperties, JSX } from 'react';
2
2
  import type { MarkdownPreviewProps } from '@uiw/react-markdown-preview/nohighlight';
3
3
  import type { ITextAreaProps } from './components/TextArea/index.nohighlight';
4
4
  import type { ICommand, TextState } from './commands';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const bold: ICommand = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const codeBlock: ICommand = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const comment: ICommand = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand } from './';
2
+ import { type ICommand } from './';
3
3
 
4
4
  export const divider: ICommand = {
5
5
  keyCommand: 'divider',
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { ICommand, TextState, TextAreaTextApi } from './';
3
- import { ContextStore, ExecuteCommandState } from '../Context';
2
+ import { type ICommand, TextState, type TextAreaTextApi } from './';
3
+ import { type ContextStore, type ExecuteCommandState } from '../Context';
4
4
 
5
5
  export const fullscreen: ICommand = {
6
6
  name: 'fullscreen',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ICommandChildCommands, ICommandChildHandle } from './';
2
+ import { type ICommand, type ICommandChildCommands, type ICommandChildHandle } from './';
3
3
 
4
4
  export type GroupOptions = Omit<ICommand<string>, 'children'> & {
5
5
  children?: ICommandChildHandle['children'];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand } from './';
3
3
 
4
4
  export const help: ICommand = {
5
5
  name: 'help',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const hr: ICommand = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const image: ICommand = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ContextStore, ExecuteCommandState } from '../Context';
2
+ import { type ContextStore, ExecuteCommandState } from '../Context';
3
3
  import { insertTextAtPosition } from '../utils/InsertTextAtPosition';
4
4
  import { bold } from './bold';
5
5
  import { code, codeBlock } from './code';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const issue: ICommand = {
@@ -12,8 +12,8 @@ export const issue: ICommand = {
12
12
  <svg role="img" width="12" height="12" viewBox="0 0 448 512">
13
13
  <path
14
14
  fill="currentColor"
15
- d="M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128h95.1l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H347.1L325.8 320H384c17.7 0 32 14.3 32 32s-14.3 32-32 32H315.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.826.3s-29.2-19.4-26.3-36.8l9.8-58.7H155.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l21.3-128H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8320h95.1l21.3-128H187.1z"
16
- //Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
15
+ d="M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128l95.1 0 11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128l58.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-68.9 0L325.8 320l58.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-68.9 0-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l9.8-58.7-95.1 0-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384 32 384c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 21.3-128L64 192c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8 320l95.1 0 21.3-128-95.1 0z"
16
+ //Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
17
17
  />
18
18
  </svg>
19
19
  ),
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const italic: ICommand = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import { selectWord, executeCommand } from '../utils/markdownUtils';
4
4
 
5
5
  export const link: ICommand = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import {
4
4
  selectWord,
5
5
  getBreaksNeededForEmptyLineBefore,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { ICommand, TextState, TextAreaTextApi } from './';
3
- import { ContextStore, ExecuteCommandState } from '../Context';
2
+ import { type ICommand, type TextState, TextAreaTextApi } from './';
3
+ import { type ContextStore, type ExecuteCommandState } from '../Context';
4
4
 
5
5
  export const codePreview: ICommand = {
6
6
  name: 'preview',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
2
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
3
3
  import {
4
4
  getBreaksNeededForEmptyLineBefore,
5
5
  getBreaksNeededForEmptyLineAfter,
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useEffect } from 'react';
2
2
  import { IProps } from '../../Types';
3
3
  import { EditorContext, ExecuteCommandState } from '../../Context';
4
- import { TextAreaCommandOrchestrator } from '../../commands';
4
+ import { TextAreaCommandOrchestrator } from '../../commands/';
5
5
  import handleKeyDown from './handleKeyDown';
6
6
  import shortcuts from './shortcuts';
7
7
  import './index.less';
@@ -1,6 +1,6 @@
1
1
  import { insertTextAtPosition } from '../../utils/InsertTextAtPosition';
2
2
  import { insertBeforeEachLine, selectLine } from '../../utils/markdownUtils';
3
- import { TextAreaTextApi } from '../../commands';
3
+ import { TextAreaTextApi } from '../../commands/';
4
4
 
5
5
  /**
6
6
  * - `13` - `Enter`
@@ -1,9 +1,9 @@
1
- import React, { useEffect, Fragment, useContext } from 'react';
1
+ import React, { useEffect, Fragment, useContext, JSX } from 'react';
2
2
  import { EditorContext, ContextStore, ExecuteCommandState } from '../../Context';
3
3
  import shortcuts from './shortcuts';
4
4
  import Textarea, { TextAreaProps } from './Textarea';
5
5
  import { IProps } from '../../Types';
6
- import { TextAreaCommandOrchestrator, ICommand } from '../../commands';
6
+ import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
7
7
  import './index.less';
8
8
 
9
9
  type RenderTextareaHandle = {
@@ -1,10 +1,10 @@
1
- import React, { useEffect, Fragment, useContext } from 'react';
1
+ import React, { useEffect, Fragment, useContext, JSX } from 'react';
2
2
  import { EditorContext, ContextStore, ExecuteCommandState } from '../../Context';
3
3
  import shortcuts from './shortcuts';
4
4
  import Markdown from './Markdown';
5
5
  import Textarea, { TextAreaProps } from './Textarea';
6
6
  import { IProps } from '../../Types';
7
- import { TextAreaCommandOrchestrator, ICommand } from '../../commands';
7
+ import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
8
8
  import './index.less';
9
9
 
10
10
  type RenderTextareaHandle = {
@@ -1,4 +1,4 @@
1
- import { ICommand, TextAreaCommandOrchestrator } from '../../commands';
1
+ import { ICommand, TextAreaCommandOrchestrator } from '../../commands/';
2
2
  import { ContextStore, ExecuteCommandState } from '../../Context';
3
3
 
4
4
  function getCommands(data: ICommand[] = [], resulte: Record<string, ICommand> = {}): Record<string, ICommand> {
@@ -1,4 +1,4 @@
1
- import React, { useContext, useMemo } from 'react';
1
+ import React, { useContext, useMemo, JSX } from 'react';
2
2
  import './Child.less';
3
3
  import Toolbar, { type IToolbarProps } from './';
4
4
  import { EditorContext } from '../../Context';
@@ -1,7 +1,7 @@
1
1
  import React, { Fragment, useContext, useEffect, useRef } from 'react';
2
2
  import { IProps } from '../../Types';
3
3
  import { EditorContext, PreviewType, ContextStore } from '../../Context';
4
- import { ICommand } from '../../commands';
4
+ import { ICommand } from '../../commands/';
5
5
  import Child from './Child';
6
6
  import './index.less';
7
7
 
@@ -1,9 +1,9 @@
1
1
  import MDEditor from './Editor.nohighlight';
2
- import * as commands from './commands';
2
+ import * as commands from './commands/';
3
3
  import * as MarkdownUtil from './utils/markdownUtils';
4
4
  import './index.less';
5
5
 
6
- export * from './commands';
6
+ export * from './commands/';
7
7
  export * from './commands/group';
8
8
  export * from './utils/markdownUtils';
9
9
  export * from './utils/InsertTextAtPosition';
package/src/index.tsx CHANGED
@@ -1,9 +1,9 @@
1
1
  import MDEditor from './Editor';
2
- import * as commands from './commands';
2
+ import * as commands from './commands/';
3
3
  import * as MarkdownUtil from './utils/markdownUtils';
4
4
  import './index.less';
5
5
 
6
- export * from './commands';
6
+ export * from './commands/';
7
7
  export * from './commands/group';
8
8
  export * from './utils/markdownUtils';
9
9
  export * from './utils/InsertTextAtPosition';
@@ -1,5 +1,4 @@
1
- import { TextRange } from '../commands';
2
- import { TextAreaTextApi, ExecuteState } from '../commands';
1
+ import { TextAreaTextApi, type TextRange } from '../commands';
3
2
 
4
3
  export interface TextSection {
5
4
  text: string;