@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.
- package/README.md +10 -2
- package/dist/mdeditor.css +107 -107
- package/dist/mdeditor.js +7858 -3897
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/esm/Context.d.ts +1 -1
- package/esm/Editor.js +5 -5
- package/esm/Editor.nohighlight.js +4 -4
- package/esm/commands/bold.d.ts +1 -1
- package/esm/commands/bold.js +1 -1
- package/esm/commands/code.d.ts +1 -1
- package/esm/commands/code.js +1 -1
- package/esm/commands/comment.d.ts +1 -1
- package/esm/commands/comment.js +1 -1
- package/esm/commands/divider.d.ts +1 -1
- package/esm/commands/fullscreen.d.ts +1 -1
- package/esm/commands/group.d.ts +1 -1
- package/esm/commands/help.d.ts +1 -1
- package/esm/commands/hr.d.ts +1 -1
- package/esm/commands/hr.js +1 -1
- package/esm/commands/image.d.ts +1 -1
- package/esm/commands/image.js +1 -1
- package/esm/commands/index.cn.js +24 -24
- package/esm/commands/index.d.ts +1 -1
- package/esm/commands/index.js +25 -25
- package/esm/commands/issue.d.ts +1 -1
- package/esm/commands/issue.js +1 -1
- package/esm/commands/italic.d.ts +1 -1
- package/esm/commands/italic.js +1 -1
- package/esm/commands/link.d.ts +1 -1
- package/esm/commands/link.js +1 -1
- package/esm/commands/list.d.ts +1 -1
- package/esm/commands/list.js +1 -1
- package/esm/commands/preview.d.ts +1 -1
- package/esm/commands/quote.d.ts +1 -1
- package/esm/commands/quote.js +1 -1
- package/esm/commands/strikeThrough.js +1 -1
- package/esm/commands/table.js +1 -1
- package/esm/commands/title.js +2 -2
- package/esm/commands/title1.js +1 -1
- package/esm/commands/title2.js +1 -1
- package/esm/commands/title3.js +1 -1
- package/esm/commands/title4.js +1 -1
- package/esm/commands/title5.js +1 -1
- package/esm/commands/title6.js +1 -1
- package/esm/components/TextArea/Markdown.js +1 -1
- package/esm/components/TextArea/Textarea.js +4 -4
- package/esm/components/TextArea/handleKeyDown.js +3 -4
- package/esm/components/TextArea/index.d.ts +1 -1
- package/esm/components/TextArea/index.js +5 -5
- package/esm/components/TextArea/index.nohighlight.d.ts +1 -1
- package/esm/components/TextArea/index.nohighlight.js +4 -4
- package/esm/components/TextArea/shortcuts.d.ts +1 -1
- package/esm/components/Toolbar/Child.js +2 -2
- package/esm/components/Toolbar/index.d.ts +1 -1
- package/esm/components/Toolbar/index.js +2 -2
- package/esm/index.css +0 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +10 -10
- package/esm/index.nohighlight.d.ts +2 -2
- package/esm/index.nohighlight.js +8 -8
- package/esm/utils/markdownUtils.d.ts +1 -2
- package/lib/Context.d.ts +1 -1
- package/lib/Editor.js +4 -4
- package/lib/Editor.nohighlight.js +3 -3
- package/lib/commands/bold.d.ts +1 -1
- package/lib/commands/code.d.ts +1 -1
- package/lib/commands/comment.d.ts +1 -1
- package/lib/commands/divider.d.ts +1 -1
- package/lib/commands/fullscreen.d.ts +1 -1
- package/lib/commands/group.d.ts +1 -1
- package/lib/commands/help.d.ts +1 -1
- package/lib/commands/hr.d.ts +1 -1
- package/lib/commands/image.d.ts +1 -1
- package/lib/commands/index.d.ts +1 -1
- package/lib/commands/issue.d.ts +1 -1
- package/lib/commands/italic.d.ts +1 -1
- package/lib/commands/link.d.ts +1 -1
- package/lib/commands/list.d.ts +1 -1
- package/lib/commands/preview.d.ts +1 -1
- package/lib/commands/quote.d.ts +1 -1
- package/lib/components/TextArea/Textarea.js +1 -1
- package/lib/components/TextArea/handleKeyDown.js +1 -1
- package/lib/components/TextArea/index.d.ts +1 -1
- package/lib/components/TextArea/index.js +1 -1
- package/lib/components/TextArea/index.nohighlight.d.ts +1 -1
- package/lib/components/TextArea/index.nohighlight.js +1 -1
- package/lib/components/TextArea/shortcuts.d.ts +1 -1
- package/lib/components/Toolbar/index.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/index.nohighlight.d.ts +2 -2
- package/lib/index.nohighlight.js +1 -1
- package/lib/utils/markdownUtils.d.ts +1 -2
- package/markdown-editor.css +0 -1
- package/package.json +1 -1
- package/src/Context.tsx +1 -1
- package/src/Editor.nohighlight.tsx +3 -3
- package/src/Editor.tsx +4 -4
- package/src/commands/bold.tsx +1 -1
- package/src/commands/code.tsx +1 -1
- package/src/commands/comment.tsx +1 -1
- package/src/commands/divider.tsx +1 -1
- package/src/commands/fullscreen.tsx +2 -2
- package/src/commands/group.tsx +1 -1
- package/src/commands/help.tsx +1 -1
- package/src/commands/hr.tsx +1 -1
- package/src/commands/image.tsx +1 -1
- package/src/commands/index.ts +1 -1
- package/src/commands/issue.tsx +1 -1
- package/src/commands/italic.tsx +1 -1
- package/src/commands/link.tsx +1 -1
- package/src/commands/list.tsx +1 -1
- package/src/commands/preview.tsx +2 -2
- package/src/commands/quote.tsx +1 -1
- package/src/components/TextArea/Textarea.tsx +1 -1
- package/src/components/TextArea/handleKeyDown.tsx +1 -1
- package/src/components/TextArea/index.nohighlight.tsx +1 -1
- package/src/components/TextArea/index.tsx +1 -1
- package/src/components/TextArea/shortcuts.ts +1 -1
- package/src/components/Toolbar/index.tsx +1 -1
- package/src/index.nohighlight.tsx +2 -2
- package/src/index.tsx +2 -2
- package/src/utils/markdownUtils.ts +1 -2
package/esm/index.nohighlight.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import MDEditor from './Editor.nohighlight';
|
|
2
|
-
import * as commands from
|
|
3
|
-
import * as MarkdownUtil from
|
|
2
|
+
import * as commands from "./commands/index.js";
|
|
3
|
+
import * as MarkdownUtil from "./utils/markdownUtils.js";
|
|
4
4
|
import "./index.css";
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
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
9
|
export * from './Editor.nohighlight';
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
10
|
+
export * from "./Context.js";
|
|
11
|
+
export * from "./Types.js";
|
|
12
12
|
export { MarkdownUtil, commands };
|
|
13
13
|
export default MDEditor;
|
package/lib/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/lib/Editor.js
CHANGED
|
@@ -11,10 +11,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactMarkdownPreview = _interopRequireDefault(require("@uiw/react-markdown-preview"));
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var _DragBar = _interopRequireDefault(require("./components/DragBar"));
|
|
17
|
-
var _commands = require("./commands");
|
|
14
|
+
var _Toolbar = require("./components/Toolbar/");
|
|
15
|
+
var _TextArea = _interopRequireDefault(require("./components/TextArea/"));
|
|
16
|
+
var _DragBar = _interopRequireDefault(require("./components/DragBar/"));
|
|
17
|
+
var _commands = require("./commands/");
|
|
18
18
|
var _Context = require("./Context");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
20
|
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"];
|
|
@@ -12,9 +12,9 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _nohighlight = _interopRequireDefault(require("@uiw/react-markdown-preview/nohighlight"));
|
|
14
14
|
var _index = _interopRequireDefault(require("./components/TextArea/index.nohighlight"));
|
|
15
|
-
var _Toolbar = require("./components/Toolbar");
|
|
16
|
-
var _DragBar = _interopRequireDefault(require("./components/DragBar"));
|
|
17
|
-
var _commands = require("./commands");
|
|
15
|
+
var _Toolbar = require("./components/Toolbar/");
|
|
16
|
+
var _DragBar = _interopRequireDefault(require("./components/DragBar/"));
|
|
17
|
+
var _commands = require("./commands/");
|
|
18
18
|
var _Context = require("./Context");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
20
|
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"];
|
package/lib/commands/bold.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const bold: ICommand;
|
package/lib/commands/code.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const comment: ICommand;
|
|
@@ -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;
|
package/lib/commands/group.d.ts
CHANGED
|
@@ -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
|
};
|
package/lib/commands/help.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const help: ICommand;
|
package/lib/commands/hr.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const hr: ICommand;
|
package/lib/commands/image.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const image: ICommand;
|
package/lib/commands/index.d.ts
CHANGED
|
@@ -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';
|
package/lib/commands/issue.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const issue: ICommand;
|
package/lib/commands/italic.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const italic: ICommand;
|
package/lib/commands/link.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const link: ICommand;
|
package/lib/commands/list.d.ts
CHANGED
|
@@ -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;
|
package/lib/commands/quote.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICommand } from './';
|
|
1
|
+
import { type ICommand } from './';
|
|
2
2
|
export declare const quote: ICommand;
|
|
@@ -11,7 +11,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _Context = require("../../Context");
|
|
14
|
-
var _commands = require("../../commands");
|
|
14
|
+
var _commands = require("../../commands/");
|
|
15
15
|
var _handleKeyDown = _interopRequireDefault(require("./handleKeyDown"));
|
|
16
16
|
var _shortcuts = _interopRequireDefault(require("./shortcuts"));
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = handleKeyDown;
|
|
7
7
|
var _InsertTextAtPosition = require("../../utils/InsertTextAtPosition");
|
|
8
8
|
var _markdownUtils = require("../../utils/markdownUtils");
|
|
9
|
-
var _commands = require("../../commands");
|
|
9
|
+
var _commands = require("../../commands/");
|
|
10
10
|
/**
|
|
11
11
|
* - `13` - `Enter`
|
|
12
12
|
* - `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'];
|
|
@@ -13,7 +13,7 @@ var _Context = require("../../Context");
|
|
|
13
13
|
var _shortcuts = _interopRequireDefault(require("./shortcuts"));
|
|
14
14
|
var _Markdown = _interopRequireDefault(require("./Markdown"));
|
|
15
15
|
var _Textarea = _interopRequireDefault(require("./Textarea"));
|
|
16
|
-
var _commands = require("../../commands");
|
|
16
|
+
var _commands = require("../../commands/");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
var _excluded = ["prefixCls", "className", "onScroll", "renderTextarea"];
|
|
19
19
|
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'];
|
|
@@ -12,7 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _Context = require("../../Context");
|
|
13
13
|
var _shortcuts = _interopRequireDefault(require("./shortcuts"));
|
|
14
14
|
var _Textarea = _interopRequireDefault(require("./Textarea"));
|
|
15
|
-
var _commands = require("../../commands");
|
|
15
|
+
var _commands = require("../../commands/");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _excluded = ["prefixCls", "className", "onScroll", "renderTextarea"];
|
|
18
18
|
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;
|
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';
|
package/lib/index.nohighlight.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;
|
package/markdown-editor.css
CHANGED
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.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,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
|
|
4
|
-
import
|
|
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/commands/bold.tsx
CHANGED
|
@@ -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 = {
|
package/src/commands/code.tsx
CHANGED
|
@@ -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 = {
|
package/src/commands/comment.tsx
CHANGED
|
@@ -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 = {
|
package/src/commands/divider.tsx
CHANGED
|
@@ -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',
|
package/src/commands/group.tsx
CHANGED
|
@@ -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'];
|
package/src/commands/help.tsx
CHANGED
package/src/commands/hr.tsx
CHANGED
package/src/commands/image.tsx
CHANGED
|
@@ -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 = {
|
package/src/commands/index.ts
CHANGED
|
@@ -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';
|
package/src/commands/issue.tsx
CHANGED
|
@@ -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 = {
|
package/src/commands/italic.tsx
CHANGED
|
@@ -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 = {
|
package/src/commands/link.tsx
CHANGED
|
@@ -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 = {
|
package/src/commands/list.tsx
CHANGED
package/src/commands/preview.tsx
CHANGED
|
@@ -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',
|
package/src/commands/quote.tsx
CHANGED
|
@@ -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`
|
|
@@ -3,7 +3,7 @@ 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 = {
|
|
@@ -4,7 +4,7 @@ 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,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';
|