@uiw/react-md-editor 4.0.5 → 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 (124) hide show
  1. package/README.md +10 -2
  2. package/dist/mdeditor.css +107 -107
  3. package/dist/mdeditor.js +7858 -3897
  4. package/dist/mdeditor.min.css +1 -1
  5. package/dist/mdeditor.min.js +1 -1
  6. package/esm/Context.d.ts +1 -1
  7. package/esm/Editor.js +5 -5
  8. package/esm/Editor.nohighlight.js +4 -4
  9. package/esm/commands/bold.d.ts +1 -1
  10. package/esm/commands/bold.js +1 -1
  11. package/esm/commands/code.d.ts +1 -1
  12. package/esm/commands/code.js +1 -1
  13. package/esm/commands/comment.d.ts +1 -1
  14. package/esm/commands/comment.js +1 -1
  15. package/esm/commands/divider.d.ts +1 -1
  16. package/esm/commands/fullscreen.d.ts +1 -1
  17. package/esm/commands/group.d.ts +1 -1
  18. package/esm/commands/help.d.ts +1 -1
  19. package/esm/commands/hr.d.ts +1 -1
  20. package/esm/commands/hr.js +1 -1
  21. package/esm/commands/image.d.ts +1 -1
  22. package/esm/commands/image.js +1 -1
  23. package/esm/commands/index.cn.js +24 -24
  24. package/esm/commands/index.d.ts +1 -1
  25. package/esm/commands/index.js +25 -25
  26. package/esm/commands/issue.d.ts +1 -1
  27. package/esm/commands/issue.js +1 -1
  28. package/esm/commands/italic.d.ts +1 -1
  29. package/esm/commands/italic.js +1 -1
  30. package/esm/commands/link.d.ts +1 -1
  31. package/esm/commands/link.js +1 -1
  32. package/esm/commands/list.d.ts +1 -1
  33. package/esm/commands/list.js +1 -1
  34. package/esm/commands/preview.d.ts +1 -1
  35. package/esm/commands/quote.d.ts +1 -1
  36. package/esm/commands/quote.js +1 -1
  37. package/esm/commands/strikeThrough.js +1 -1
  38. package/esm/commands/table.js +1 -1
  39. package/esm/commands/title.js +2 -2
  40. package/esm/commands/title1.js +1 -1
  41. package/esm/commands/title2.js +1 -1
  42. package/esm/commands/title3.js +1 -1
  43. package/esm/commands/title4.js +1 -1
  44. package/esm/commands/title5.js +1 -1
  45. package/esm/commands/title6.js +1 -1
  46. package/esm/components/TextArea/Markdown.js +1 -1
  47. package/esm/components/TextArea/Textarea.js +4 -4
  48. package/esm/components/TextArea/handleKeyDown.js +3 -4
  49. package/esm/components/TextArea/index.d.ts +1 -1
  50. package/esm/components/TextArea/index.js +5 -5
  51. package/esm/components/TextArea/index.nohighlight.d.ts +1 -1
  52. package/esm/components/TextArea/index.nohighlight.js +4 -4
  53. package/esm/components/TextArea/shortcuts.d.ts +1 -1
  54. package/esm/components/Toolbar/Child.js +2 -2
  55. package/esm/components/Toolbar/index.d.ts +1 -1
  56. package/esm/components/Toolbar/index.js +2 -2
  57. package/esm/index.css +0 -1
  58. package/esm/index.d.ts +2 -2
  59. package/esm/index.js +10 -10
  60. package/esm/index.nohighlight.d.ts +2 -2
  61. package/esm/index.nohighlight.js +8 -8
  62. package/esm/utils/markdownUtils.d.ts +1 -2
  63. package/lib/Context.d.ts +1 -1
  64. package/lib/Editor.js +4 -4
  65. package/lib/Editor.nohighlight.js +3 -3
  66. package/lib/commands/bold.d.ts +1 -1
  67. package/lib/commands/code.d.ts +1 -1
  68. package/lib/commands/comment.d.ts +1 -1
  69. package/lib/commands/divider.d.ts +1 -1
  70. package/lib/commands/fullscreen.d.ts +1 -1
  71. package/lib/commands/group.d.ts +1 -1
  72. package/lib/commands/help.d.ts +1 -1
  73. package/lib/commands/hr.d.ts +1 -1
  74. package/lib/commands/image.d.ts +1 -1
  75. package/lib/commands/index.d.ts +1 -1
  76. package/lib/commands/issue.d.ts +1 -1
  77. package/lib/commands/italic.d.ts +1 -1
  78. package/lib/commands/link.d.ts +1 -1
  79. package/lib/commands/list.d.ts +1 -1
  80. package/lib/commands/preview.d.ts +1 -1
  81. package/lib/commands/quote.d.ts +1 -1
  82. package/lib/components/TextArea/Textarea.js +1 -1
  83. package/lib/components/TextArea/handleKeyDown.js +1 -1
  84. package/lib/components/TextArea/index.d.ts +1 -1
  85. package/lib/components/TextArea/index.js +1 -1
  86. package/lib/components/TextArea/index.nohighlight.d.ts +1 -1
  87. package/lib/components/TextArea/index.nohighlight.js +1 -1
  88. package/lib/components/TextArea/shortcuts.d.ts +1 -1
  89. package/lib/components/Toolbar/index.d.ts +1 -1
  90. package/lib/index.d.ts +2 -2
  91. package/lib/index.js +1 -1
  92. package/lib/index.nohighlight.d.ts +2 -2
  93. package/lib/index.nohighlight.js +1 -1
  94. package/lib/utils/markdownUtils.d.ts +1 -2
  95. package/markdown-editor.css +0 -1
  96. package/package.json +1 -1
  97. package/src/Context.tsx +1 -1
  98. package/src/Editor.nohighlight.tsx +3 -3
  99. package/src/Editor.tsx +4 -4
  100. package/src/commands/bold.tsx +1 -1
  101. package/src/commands/code.tsx +1 -1
  102. package/src/commands/comment.tsx +1 -1
  103. package/src/commands/divider.tsx +1 -1
  104. package/src/commands/fullscreen.tsx +2 -2
  105. package/src/commands/group.tsx +1 -1
  106. package/src/commands/help.tsx +1 -1
  107. package/src/commands/hr.tsx +1 -1
  108. package/src/commands/image.tsx +1 -1
  109. package/src/commands/index.ts +1 -1
  110. package/src/commands/issue.tsx +1 -1
  111. package/src/commands/italic.tsx +1 -1
  112. package/src/commands/link.tsx +1 -1
  113. package/src/commands/list.tsx +1 -1
  114. package/src/commands/preview.tsx +2 -2
  115. package/src/commands/quote.tsx +1 -1
  116. package/src/components/TextArea/Textarea.tsx +1 -1
  117. package/src/components/TextArea/handleKeyDown.tsx +1 -1
  118. package/src/components/TextArea/index.nohighlight.tsx +1 -1
  119. package/src/components/TextArea/index.tsx +1 -1
  120. package/src/components/TextArea/shortcuts.ts +1 -1
  121. package/src/components/Toolbar/index.tsx +1 -1
  122. package/src/index.nohighlight.tsx +2 -2
  123. package/src/index.tsx +2 -2
  124. package/src/utils/markdownUtils.ts +1 -2
package/esm/Context.d.ts 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
  export type PreviewType = 'live' | 'edit' | 'preview';
5
5
  export interface ContextStore {
package/esm/Editor.js CHANGED
@@ -3,11 +3,11 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
3
3
  var _excluded = ["prefixCls", "className", "value", "commands", "commandsFilter", "direction", "extraCommands", "height", "enableScroll", "visibleDragbar", "highlightEnable", "preview", "fullscreen", "overflow", "previewOptions", "textareaProps", "maxHeight", "minHeight", "autoFocus", "tabSize", "defaultTabEnable", "onChange", "onStatistics", "onHeightChange", "hideToolbar", "toolbarBottom", "components", "renderTextarea"];
4
4
  import React, { useEffect, useReducer, useMemo, useRef, useImperativeHandle } from 'react';
5
5
  import MarkdownPreview from '@uiw/react-markdown-preview';
6
- import TextArea from './components/TextArea';
7
- import { ToolbarVisibility } from './components/Toolbar';
8
- import DragBar from './components/DragBar';
9
- import { getCommands, getExtraCommands, TextAreaCommandOrchestrator } from './commands';
10
- import { reducer, EditorContext } from './Context';
6
+ import { ToolbarVisibility } from "./components/Toolbar/index.js";
7
+ import TextArea from "./components/TextArea/index.js";
8
+ import DragBar from "./components/DragBar/index.js";
9
+ import { getCommands, getExtraCommands, TextAreaCommandOrchestrator } from "./commands/index.js";
10
+ import { reducer, EditorContext } from "./Context.js";
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  function setGroupPopFalse(data) {
13
13
  if (data === void 0) {
@@ -4,10 +4,10 @@ var _excluded = ["prefixCls", "className", "value", "commands", "commandsFilter"
4
4
  import React, { useEffect, useReducer, useMemo, useRef, useImperativeHandle } from 'react';
5
5
  import MarkdownPreview from '@uiw/react-markdown-preview/nohighlight';
6
6
  import TextArea from './components/TextArea/index.nohighlight';
7
- import { ToolbarVisibility } from './components/Toolbar';
8
- import DragBar from './components/DragBar';
9
- import { getCommands, getExtraCommands, TextAreaCommandOrchestrator } from './commands';
10
- import { reducer, EditorContext } from './Context';
7
+ import { ToolbarVisibility } from "./components/Toolbar/index.js";
8
+ import DragBar from "./components/DragBar/index.js";
9
+ import { getCommands, getExtraCommands, TextAreaCommandOrchestrator } from "./commands/index.js";
10
+ import { reducer, EditorContext } from "./Context.js";
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  function setGroupPopFalse(data) {
13
13
  if (data === void 0) {
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const bold: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var bold = {
5
5
  name: 'bold',
@@ -1,3 +1,3 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const codeBlock: ICommand;
3
3
  export declare const code: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var codeBlock = {
5
5
  name: 'codeBlock',
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const comment: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  export var comment = {
5
5
  name: 'comment',
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const divider: ICommand;
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const fullscreen: ICommand;
@@ -1,4 +1,4 @@
1
- import { ICommand, ICommandChildCommands, ICommandChildHandle } from './';
1
+ import { type ICommand, type ICommandChildCommands, type ICommandChildHandle } from './';
2
2
  export type GroupOptions = Omit<ICommand<string>, 'children'> & {
3
3
  children?: ICommandChildHandle['children'];
4
4
  };
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const help: ICommand;
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const hr: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var hr = {
5
5
  name: 'hr',
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const image: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var image = {
5
5
  name: 'image',
@@ -1,28 +1,28 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { divider } from './divider';
3
- import { group } from './group';
4
- import { bold as boldInit } from './bold';
5
- import { code as codeInit, codeBlock as codeBlockInit } from './code';
6
- import { comment as commentInit } from './comment';
7
- import { fullscreen as fullscreenInit } from './fullscreen';
8
- import { hr as hrInit } from './hr';
9
- import { image as imageInit } from './image';
10
- import { italic as italicInit } from './italic';
11
- import { link as linkInit } from './link';
12
- import { checkedListCommand as checkedListCommandInit, orderedListCommand as orderedListCommandInit, unorderedListCommand as unorderedListCommandInit } from './list';
13
- import { codeEdit as codeEditInit, codeLive as codeLiveInit, codePreview as codePreviewInit } from './preview';
14
- import { quote as quoteInit } from './quote';
15
- import { strikethrough as strikethroughInit } from './strikeThrough';
16
- import { issue as issueInit } from './issue';
17
- import { title as titleInit } from './title';
18
- import { title1 as title1Init } from './title1';
19
- import { title2 as title2Init } from './title2';
20
- import { title3 as title3Init } from './title3';
21
- import { title4 as title4Init } from './title4';
22
- import { title5 as title5Init } from './title5';
23
- import { title6 as title6Init } from './title6';
24
- import { table as tableInit } from './table';
25
- import { help as helpInit } from './help';
2
+ import { divider } from "./divider.js";
3
+ import { group } from "./group.js";
4
+ import { bold as boldInit } from "./bold.js";
5
+ import { code as codeInit, codeBlock as codeBlockInit } from "./code.js";
6
+ import { comment as commentInit } from "./comment.js";
7
+ import { fullscreen as fullscreenInit } from "./fullscreen.js";
8
+ import { hr as hrInit } from "./hr.js";
9
+ import { image as imageInit } from "./image.js";
10
+ import { italic as italicInit } from "./italic.js";
11
+ import { link as linkInit } from "./link.js";
12
+ import { checkedListCommand as checkedListCommandInit, orderedListCommand as orderedListCommandInit, unorderedListCommand as unorderedListCommandInit } from "./list.js";
13
+ import { codeEdit as codeEditInit, codeLive as codeLiveInit, codePreview as codePreviewInit } from "./preview.js";
14
+ import { quote as quoteInit } from "./quote.js";
15
+ import { strikethrough as strikethroughInit } from "./strikeThrough.js";
16
+ import { issue as issueInit } from "./issue.js";
17
+ import { title as titleInit } from "./title.js";
18
+ import { title1 as title1Init } from "./title1.js";
19
+ import { title2 as title2Init } from "./title2.js";
20
+ import { title3 as title3Init } from "./title3.js";
21
+ import { title4 as title4Init } from "./title4.js";
22
+ import { title5 as title5Init } from "./title5.js";
23
+ import { title6 as title6Init } from "./title6.js";
24
+ import { table as tableInit } from "./table.js";
25
+ import { help as helpInit } from "./help.js";
26
26
  var bold = _extends({}, boldInit, {
27
27
  buttonProps: {
28
28
  'aria-label': '添加粗体文本(ctrl + b)',
@@ -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 { bold } from './bold';
4
4
  import { code, codeBlock } from './code';
5
5
  import { comment } from './comment';
@@ -1,29 +1,29 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { insertTextAtPosition } from '../utils/InsertTextAtPosition';
3
- import { bold } from './bold';
4
- import { code, codeBlock } from './code';
5
- import { comment } from './comment';
6
- import { divider } from './divider';
7
- import { fullscreen } from './fullscreen';
8
- import { group } from './group';
9
- import { hr } from './hr';
10
- import { image } from './image';
11
- import { italic } from './italic';
12
- import { link } from './link';
13
- import { checkedListCommand, orderedListCommand, unorderedListCommand } from './list';
14
- import { codeEdit, codeLive, codePreview } from './preview';
15
- import { quote } from './quote';
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';
24
- import { table } from './table';
25
- import { issue } from './issue';
26
- import { help } from './help';
2
+ import { insertTextAtPosition } from "../utils/InsertTextAtPosition.js";
3
+ import { bold } from "./bold.js";
4
+ import { code, codeBlock } from "./code.js";
5
+ import { comment } from "./comment.js";
6
+ import { divider } from "./divider.js";
7
+ import { fullscreen } from "./fullscreen.js";
8
+ import { group } from "./group.js";
9
+ import { hr } from "./hr.js";
10
+ import { image } from "./image.js";
11
+ import { italic } from "./italic.js";
12
+ import { link } from "./link.js";
13
+ import { checkedListCommand, orderedListCommand, unorderedListCommand } from "./list.js";
14
+ import { codeEdit, codeLive, codePreview } from "./preview.js";
15
+ import { quote } from "./quote.js";
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";
24
+ import { table } from "./table.js";
25
+ import { issue } from "./issue.js";
26
+ import { help } from "./help.js";
27
27
  var getCommands = () => [bold, italic, strikethrough, hr, group([title1, title2, title3, title4, title5, title6], {
28
28
  name: 'title',
29
29
  groupName: 'title',
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const issue: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var issue = {
5
5
  name: 'issue',
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const italic: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var italic = {
5
5
  name: 'italic',
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const link: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var link = {
5
5
  name: 'link',
@@ -1,4 +1,4 @@
1
- import { ICommand, ExecuteState, TextAreaTextApi } from './';
1
+ import { type ICommand, type ExecuteState, TextAreaTextApi } from './';
2
2
  import { AlterLineFunction } from '../utils/markdownUtils';
3
3
  export declare const makeList: (state: ExecuteState, api: TextAreaTextApi, insertBefore: string | AlterLineFunction) => void;
4
4
  export declare const unorderedListCommand: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, getBreaksNeededForEmptyLineBefore, getBreaksNeededForEmptyLineAfter, insertBeforeEachLine } from '../utils/markdownUtils';
2
+ import { selectWord, getBreaksNeededForEmptyLineBefore, getBreaksNeededForEmptyLineAfter, insertBeforeEachLine } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var makeList = (state, api, insertBefore) => {
5
5
  var newSelectionRange = selectWord({
@@ -1,4 +1,4 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const codePreview: ICommand;
3
3
  export declare const codeEdit: ICommand;
4
4
  export declare const codeLive: ICommand;
@@ -1,2 +1,2 @@
1
- import { ICommand } from './';
1
+ import { type ICommand } from './';
2
2
  export declare const quote: ICommand;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { getBreaksNeededForEmptyLineBefore, getBreaksNeededForEmptyLineAfter, selectWord, insertBeforeEachLine } from '../utils/markdownUtils';
2
+ import { getBreaksNeededForEmptyLineBefore, getBreaksNeededForEmptyLineAfter, selectWord, insertBeforeEachLine } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var quote = {
5
5
  name: 'quote',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var strikethrough = {
5
5
  name: 'strikethrough',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { selectWord, executeCommand } from '../utils/markdownUtils';
2
+ import { selectWord, executeCommand } from "../utils/markdownUtils.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var table = {
5
5
  name: 'table',
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { title1 } from './title1';
4
- import { selectLine, executeCommand } from '../utils/markdownUtils';
3
+ import { title1 } from "./title1.js";
4
+ import { selectLine, executeCommand } from "../utils/markdownUtils.js";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  export function titleExecute(_ref) {
7
7
  var {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { titleExecute } from "../commands/title.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var title1 = {
5
5
  name: 'title1',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { titleExecute } from "../commands/title.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var title2 = {
5
5
  name: 'title2',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { titleExecute } from "../commands/title.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var title3 = {
5
5
  name: 'title3',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { titleExecute } from "../commands/title.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var title4 = {
5
5
  name: 'title4',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { titleExecute } from "../commands/title.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var title5 = {
5
5
  name: 'title5',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { titleExecute } from '../commands/title';
2
+ import { titleExecute } from "../commands/title.js";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var title6 = {
5
5
  name: 'title6',
@@ -3,7 +3,7 @@ var _templateObject;
3
3
  import React, { useContext, useEffect } from 'react';
4
4
  import { rehype } from 'rehype';
5
5
  import rehypePrism from 'rehype-prism-plus';
6
- import { EditorContext } from '../../Context';
6
+ import { EditorContext } from "../../Context.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  function html2Escape(sHtml) {
9
9
  return sHtml
@@ -3,10 +3,10 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
3
3
  var _excluded = ["prefixCls", "onChange"],
4
4
  _excluded2 = ["markdown", "commands", "fullscreen", "preview", "highlightEnable", "extraCommands", "tabSize", "defaultTabEnable", "dispatch"];
5
5
  import React, { useContext, useEffect } from 'react';
6
- import { EditorContext } from '../../Context';
7
- import { TextAreaCommandOrchestrator } from '../../commands';
8
- import handleKeyDown from './handleKeyDown';
9
- import shortcuts from './shortcuts';
6
+ import { EditorContext } from "../../Context.js";
7
+ import { TextAreaCommandOrchestrator } from "../../commands/index.js";
8
+ import handleKeyDown from "./handleKeyDown.js";
9
+ import shortcuts from "./shortcuts.js";
10
10
  import "./index.css";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  export default function Textarea(props) {
@@ -1,7 +1,6 @@
1
- import { insertTextAtPosition } from '../../utils/InsertTextAtPosition';
2
- import { insertBeforeEachLine, selectLine } from '../../utils/markdownUtils';
3
- import { TextAreaTextApi } from '../../commands';
4
-
1
+ import { insertTextAtPosition } from "../../utils/InsertTextAtPosition.js";
2
+ import { insertBeforeEachLine, selectLine } from "../../utils/markdownUtils.js";
3
+ import { TextAreaTextApi } from "../../commands/index.js";
5
4
  /**
6
5
  * - `13` - `Enter`
7
6
  * - `9` - `Tab`
@@ -2,7 +2,7 @@ import React, { JSX } from 'react';
2
2
  import { ContextStore, ExecuteCommandState } from '../../Context';
3
3
  import { TextAreaProps } from './Textarea';
4
4
  import { IProps } from '../../Types';
5
- import { TextAreaCommandOrchestrator, ICommand } from '../../commands';
5
+ import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
6
6
  import './index.less';
7
7
  type RenderTextareaHandle = {
8
8
  dispatch: ContextStore['dispatch'];
@@ -2,11 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
3
  var _excluded = ["prefixCls", "className", "onScroll", "renderTextarea"];
4
4
  import React, { useEffect, Fragment, useContext } from 'react';
5
- import { EditorContext } from '../../Context';
6
- import shortcuts from './shortcuts';
7
- import Markdown from './Markdown';
8
- import Textarea from './Textarea';
9
- import { TextAreaCommandOrchestrator } from '../../commands';
5
+ import { EditorContext } from "../../Context.js";
6
+ import shortcuts from "./shortcuts.js";
7
+ import Markdown from "./Markdown.js";
8
+ import Textarea from "./Textarea.js";
9
+ import { TextAreaCommandOrchestrator } from "../../commands/index.js";
10
10
  import "./index.css";
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  export default function TextArea(props) {
@@ -2,7 +2,7 @@ import React, { JSX } from 'react';
2
2
  import { ContextStore, ExecuteCommandState } from '../../Context';
3
3
  import { TextAreaProps } from './Textarea';
4
4
  import { IProps } from '../../Types';
5
- import { TextAreaCommandOrchestrator, ICommand } from '../../commands';
5
+ import { TextAreaCommandOrchestrator, ICommand } from '../../commands/';
6
6
  import './index.less';
7
7
  type RenderTextareaHandle = {
8
8
  dispatch: ContextStore['dispatch'];
@@ -2,10 +2,10 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
3
  var _excluded = ["prefixCls", "className", "onScroll", "renderTextarea"];
4
4
  import React, { useEffect, Fragment, useContext } from 'react';
5
- import { EditorContext } from '../../Context';
6
- import shortcuts from './shortcuts';
7
- import Textarea from './Textarea';
8
- import { TextAreaCommandOrchestrator } from '../../commands';
5
+ import { EditorContext } from "../../Context.js";
6
+ import shortcuts from "./shortcuts.js";
7
+ import Textarea from "./Textarea.js";
8
+ import { TextAreaCommandOrchestrator } from "../../commands/index.js";
9
9
  import "./index.css";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  export default function TextArea(props) {
@@ -1,3 +1,3 @@
1
- import { ICommand, TextAreaCommandOrchestrator } from '../../commands';
1
+ import { ICommand, TextAreaCommandOrchestrator } from '../../commands/';
2
2
  import { ContextStore, ExecuteCommandState } from '../../Context';
3
3
  export default function shortcutsHandle(e: KeyboardEvent | React.KeyboardEvent<HTMLTextAreaElement>, commands?: ICommand[], commandOrchestrator?: TextAreaCommandOrchestrator, dispatch?: React.Dispatch<ContextStore>, state?: ExecuteCommandState): void;
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useContext, useMemo } from 'react';
3
3
  import "./Child.css";
4
- import Toolbar from './';
5
- import { EditorContext } from '../../Context';
4
+ import Toolbar from "./index.js";
5
+ import { EditorContext } from "../../Context.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export default function Child(props) {
8
8
  var {
@@ -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;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { Fragment, useContext, useEffect, useRef } from 'react';
3
- import { EditorContext } from '../../Context';
4
- import Child from './Child';
3
+ import { EditorContext } from "../../Context.js";
4
+ import Child from "./Child.js";
5
5
  import "./index.css";
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  export function ToolbarItems(props) {
package/esm/index.css CHANGED
@@ -27,7 +27,6 @@
27
27
  text-align: right !important;
28
28
  }
29
29
  .w-md-editor-toolbar {
30
- height: -webkit-fit-content;
31
30
  height: fit-content;
32
31
  }
33
32
  .w-md-editor-content {
package/esm/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/esm/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import MDEditor from './Editor';
2
- import * as commands from './commands';
3
- import * as MarkdownUtil from './utils/markdownUtils';
1
+ import MDEditor from "./Editor.js";
2
+ import * as commands from "./commands/index.js";
3
+ import * as MarkdownUtil from "./utils/markdownUtils.js";
4
4
  import "./index.css";
5
- export * from './commands';
6
- export * from './commands/group';
7
- export * from './utils/markdownUtils';
8
- export * from './utils/InsertTextAtPosition';
9
- export * from './Editor';
10
- export * from './Context';
11
- export * from './Types';
5
+ export * from "./commands/index.js";
6
+ export * from "./commands/group.js";
7
+ export * from "./utils/markdownUtils.js";
8
+ export * from "./utils/InsertTextAtPosition.js";
9
+ export * from "./Editor.js";
10
+ export * from "./Context.js";
11
+ export * from "./Types.js";
12
12
  export { MarkdownUtil, commands };
13
13
  export default MDEditor;
@@ -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';