@uiw/react-md-editor 4.0.10 → 4.1.0
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 +39 -4
- package/common.d.ts +17 -0
- package/dist/mdeditor.css +105 -110
- package/dist/mdeditor.js +7122 -9557
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/dist/mdeditor.min.js.LICENSE.txt +2 -2
- package/esm/Editor.common.d.ts +5 -0
- package/esm/Editor.common.js +7 -0
- package/esm/Editor.d.ts +4 -11
- package/esm/Editor.factory.d.ts +14 -0
- package/esm/Editor.factory.js +270 -0
- package/esm/Editor.js +5 -261
- package/esm/Editor.nohighlight.d.ts +4 -11
- package/esm/Editor.nohighlight.js +5 -261
- package/esm/components/TextArea/Markdown.common.d.ts +5 -0
- package/esm/components/TextArea/Markdown.common.js +59 -0
- package/esm/components/TextArea/factory.d.ts +33 -0
- package/esm/components/TextArea/factory.js +105 -0
- package/esm/components/TextArea/index.common.d.ts +3 -0
- package/esm/components/TextArea/index.common.js +6 -0
- package/esm/components/TextArea/index.d.ts +3 -27
- package/esm/components/TextArea/index.js +5 -100
- package/esm/components/TextArea/index.nohighlight.d.ts +3 -27
- package/esm/components/TextArea/index.nohighlight.js +2 -93
- package/esm/index.common.d.ts +16 -0
- package/esm/index.common.js +16 -0
- package/esm/index.css +0 -1
- package/esm/react-markdown-preview.common.d.ts +4 -0
- package/lib/Editor.common.d.ts +5 -0
- package/lib/Editor.common.js +15 -0
- package/lib/Editor.d.ts +4 -11
- package/lib/Editor.factory.d.ts +14 -0
- package/lib/Editor.factory.js +333 -0
- package/lib/Editor.js +4 -318
- package/lib/Editor.nohighlight.d.ts +4 -11
- package/lib/Editor.nohighlight.js +4 -318
- package/lib/components/TextArea/Markdown.common.d.ts +5 -0
- package/lib/components/TextArea/Markdown.common.js +68 -0
- package/lib/components/TextArea/factory.d.ts +33 -0
- package/lib/components/TextArea/factory.js +109 -0
- package/lib/components/TextArea/index.common.d.ts +3 -0
- package/lib/components/TextArea/index.common.js +14 -0
- package/lib/components/TextArea/index.d.ts +3 -27
- package/lib/components/TextArea/index.js +6 -98
- package/lib/components/TextArea/index.nohighlight.d.ts +3 -27
- package/lib/components/TextArea/index.nohighlight.js +3 -92
- package/lib/index.common.d.ts +16 -0
- package/lib/index.common.js +123 -0
- package/lib/react-markdown-preview.common.d.ts +4 -0
- package/markdown-editor.css +0 -1
- package/nohighlight.d.ts +2 -0
- package/package.json +8 -2
- package/src/Editor.common.tsx +7 -0
- package/src/Editor.factory.tsx +286 -0
- package/src/Editor.nohighlight.tsx +3 -271
- package/src/Editor.tsx +3 -271
- package/src/components/TextArea/Markdown.common.tsx +49 -0
- package/src/components/TextArea/factory.tsx +120 -0
- package/src/components/TextArea/index.common.tsx +6 -0
- package/src/components/TextArea/index.nohighlight.tsx +3 -108
- package/src/components/TextArea/index.tsx +3 -110
- package/src/index.common.tsx +19 -0
- package/src/react-markdown-preview.common.d.ts +4 -0
|
@@ -1,106 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports["default"] =
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _Context = require("../../Context");
|
|
13
|
-
var _shortcuts = _interopRequireDefault(require("./shortcuts"));
|
|
7
|
+
exports["default"] = void 0;
|
|
14
8
|
var _Markdown = _interopRequireDefault(require("./Markdown"));
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _ref = props || {},
|
|
21
|
-
prefixCls = _ref.prefixCls,
|
|
22
|
-
className = _ref.className,
|
|
23
|
-
onScroll = _ref.onScroll,
|
|
24
|
-
renderTextarea = _ref.renderTextarea,
|
|
25
|
-
otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
26
|
-
var _useContext = (0, _react.useContext)(_Context.EditorContext),
|
|
27
|
-
markdown = _useContext.markdown,
|
|
28
|
-
scrollTop = _useContext.scrollTop,
|
|
29
|
-
commands = _useContext.commands,
|
|
30
|
-
minHeight = _useContext.minHeight,
|
|
31
|
-
highlightEnable = _useContext.highlightEnable,
|
|
32
|
-
extraCommands = _useContext.extraCommands,
|
|
33
|
-
dispatch = _useContext.dispatch;
|
|
34
|
-
var textRef = _react["default"].useRef(null);
|
|
35
|
-
var executeRef = _react["default"].useRef();
|
|
36
|
-
var warp = /*#__PURE__*/_react["default"].createRef();
|
|
37
|
-
(0, _react.useEffect)(function () {
|
|
38
|
-
var state = {};
|
|
39
|
-
if (warp.current) {
|
|
40
|
-
state.textareaWarp = warp.current || undefined;
|
|
41
|
-
warp.current.scrollTop = scrollTop || 0;
|
|
42
|
-
}
|
|
43
|
-
if (dispatch) {
|
|
44
|
-
dispatch((0, _objectSpread2["default"])({}, state));
|
|
45
|
-
}
|
|
46
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
-
}, []);
|
|
48
|
-
(0, _react.useEffect)(function () {
|
|
49
|
-
if (textRef.current && dispatch) {
|
|
50
|
-
var commandOrchestrator = new _commands.TextAreaCommandOrchestrator(textRef.current);
|
|
51
|
-
executeRef.current = commandOrchestrator;
|
|
52
|
-
dispatch({
|
|
53
|
-
textarea: textRef.current,
|
|
54
|
-
commandOrchestrator: commandOrchestrator
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
|
-
}, []);
|
|
59
|
-
var textStyle = highlightEnable ? {} : {
|
|
60
|
-
WebkitTextFillColor: 'initial',
|
|
61
|
-
overflow: 'auto'
|
|
62
|
-
};
|
|
63
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
64
|
-
ref: warp,
|
|
65
|
-
className: "".concat(prefixCls, "-area ").concat(className || ''),
|
|
66
|
-
onScroll: onScroll,
|
|
67
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
68
|
-
className: "".concat(prefixCls, "-text"),
|
|
69
|
-
style: {
|
|
70
|
-
minHeight: minHeight
|
|
71
|
-
},
|
|
72
|
-
children: renderTextarea ? (/*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
73
|
-
value: markdown,
|
|
74
|
-
autoComplete: 'off',
|
|
75
|
-
autoCorrect: 'off',
|
|
76
|
-
spellCheck: 'false',
|
|
77
|
-
autoCapitalize: 'off',
|
|
78
|
-
className: "".concat(prefixCls, "-text-input"),
|
|
79
|
-
style: {
|
|
80
|
-
WebkitTextFillColor: 'inherit',
|
|
81
|
-
overflow: 'auto'
|
|
82
|
-
}
|
|
83
|
-
}), {
|
|
84
|
-
dispatch: dispatch,
|
|
85
|
-
onChange: otherProps.onChange,
|
|
86
|
-
shortcuts: _shortcuts["default"],
|
|
87
|
-
useContext: {
|
|
88
|
-
commands: commands,
|
|
89
|
-
extraCommands: extraCommands,
|
|
90
|
-
commandOrchestrator: executeRef.current
|
|
91
|
-
}
|
|
92
|
-
}), {
|
|
93
|
-
ref: textRef
|
|
94
|
-
})) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
95
|
-
children: [highlightEnable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Markdown["default"], {
|
|
96
|
-
prefixCls: prefixCls
|
|
97
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Textarea["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
98
|
-
prefixCls: prefixCls
|
|
99
|
-
}, otherProps), {}, {
|
|
100
|
-
style: textStyle
|
|
101
|
-
}))]
|
|
102
|
-
})
|
|
103
|
-
})
|
|
104
|
-
});
|
|
105
|
-
}
|
|
9
|
+
var _factory = require("./factory");
|
|
10
|
+
var _default = exports["default"] = (0, _factory.createTextArea)({
|
|
11
|
+
Markdown: _Markdown["default"],
|
|
12
|
+
useMinHeight: true
|
|
13
|
+
});
|
|
106
14
|
module.exports = exports.default;
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { type IProps } from '../../Types';
|
|
5
|
-
import { TextAreaCommandOrchestrator, type ICommand } from '../../commands/';
|
|
6
|
-
import './index.less';
|
|
7
|
-
type RenderTextareaHandle = {
|
|
8
|
-
dispatch: ContextStore['dispatch'];
|
|
9
|
-
onChange?: TextAreaProps['onChange'];
|
|
10
|
-
useContext?: {
|
|
11
|
-
commands: ContextStore['commands'];
|
|
12
|
-
extraCommands: ContextStore['extraCommands'];
|
|
13
|
-
commandOrchestrator?: TextAreaCommandOrchestrator;
|
|
14
|
-
};
|
|
15
|
-
shortcuts?: (e: KeyboardEvent | React.KeyboardEvent<HTMLTextAreaElement>, commands: ICommand[], commandOrchestrator?: TextAreaCommandOrchestrator, dispatch?: React.Dispatch<ContextStore>, state?: ExecuteCommandState) => void;
|
|
16
|
-
};
|
|
17
|
-
export interface ITextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onScroll'>, IProps {
|
|
18
|
-
value?: string;
|
|
19
|
-
onScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
|
|
20
|
-
renderTextarea?: (props: React.TextareaHTMLAttributes<HTMLTextAreaElement> | React.HTMLAttributes<HTMLDivElement>, opts: RenderTextareaHandle) => JSX.Element;
|
|
21
|
-
}
|
|
22
|
-
export type TextAreaRef = {
|
|
23
|
-
text?: HTMLTextAreaElement;
|
|
24
|
-
warp?: HTMLDivElement;
|
|
25
|
-
};
|
|
26
|
-
export default function TextArea(props: ITextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export {};
|
|
1
|
+
export type { ITextAreaProps, RenderTextareaHandle, TextAreaRef } from './factory';
|
|
2
|
+
declare const _default: (props: import("./factory").ITextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default _default;
|
|
@@ -1,98 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports["default"] =
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _Context = require("../../Context");
|
|
13
|
-
var _shortcuts = _interopRequireDefault(require("./shortcuts"));
|
|
14
|
-
var _Textarea = _interopRequireDefault(require("./Textarea"));
|
|
15
|
-
var _commands = require("../../commands/");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["prefixCls", "className", "onScroll", "renderTextarea"];
|
|
18
|
-
function TextArea(props) {
|
|
19
|
-
var _ref = props || {},
|
|
20
|
-
prefixCls = _ref.prefixCls,
|
|
21
|
-
className = _ref.className,
|
|
22
|
-
onScroll = _ref.onScroll,
|
|
23
|
-
renderTextarea = _ref.renderTextarea,
|
|
24
|
-
otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
25
|
-
var _useContext = (0, _react.useContext)(_Context.EditorContext),
|
|
26
|
-
markdown = _useContext.markdown,
|
|
27
|
-
scrollTop = _useContext.scrollTop,
|
|
28
|
-
commands = _useContext.commands,
|
|
29
|
-
extraCommands = _useContext.extraCommands,
|
|
30
|
-
dispatch = _useContext.dispatch;
|
|
31
|
-
var textRef = _react["default"].useRef(null);
|
|
32
|
-
var executeRef = _react["default"].useRef();
|
|
33
|
-
var warp = /*#__PURE__*/_react["default"].createRef();
|
|
34
|
-
(0, _react.useEffect)(function () {
|
|
35
|
-
var state = {};
|
|
36
|
-
if (warp.current) {
|
|
37
|
-
state.textareaWarp = warp.current || undefined;
|
|
38
|
-
warp.current.scrollTop = scrollTop || 0;
|
|
39
|
-
}
|
|
40
|
-
if (dispatch) {
|
|
41
|
-
dispatch((0, _objectSpread2["default"])({}, state));
|
|
42
|
-
}
|
|
43
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
-
}, []);
|
|
45
|
-
(0, _react.useEffect)(function () {
|
|
46
|
-
if (textRef.current && dispatch) {
|
|
47
|
-
var commandOrchestrator = new _commands.TextAreaCommandOrchestrator(textRef.current);
|
|
48
|
-
executeRef.current = commandOrchestrator;
|
|
49
|
-
dispatch({
|
|
50
|
-
textarea: textRef.current,
|
|
51
|
-
commandOrchestrator: commandOrchestrator
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
-
}, []);
|
|
56
|
-
var textStyle = {
|
|
57
|
-
WebkitTextFillColor: 'initial',
|
|
58
|
-
overflow: 'auto'
|
|
59
|
-
};
|
|
60
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
61
|
-
ref: warp,
|
|
62
|
-
className: "".concat(prefixCls, "-area ").concat(className || ''),
|
|
63
|
-
onScroll: onScroll,
|
|
64
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
65
|
-
className: "".concat(prefixCls, "-text"),
|
|
66
|
-
children: renderTextarea ? (/*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
67
|
-
value: markdown,
|
|
68
|
-
autoComplete: 'off',
|
|
69
|
-
autoCorrect: 'off',
|
|
70
|
-
spellCheck: 'false',
|
|
71
|
-
autoCapitalize: 'off',
|
|
72
|
-
className: "".concat(prefixCls, "-text-input"),
|
|
73
|
-
style: {
|
|
74
|
-
WebkitTextFillColor: 'inherit',
|
|
75
|
-
overflow: 'auto'
|
|
76
|
-
}
|
|
77
|
-
}), {
|
|
78
|
-
dispatch: dispatch,
|
|
79
|
-
onChange: otherProps.onChange,
|
|
80
|
-
shortcuts: _shortcuts["default"],
|
|
81
|
-
useContext: {
|
|
82
|
-
commands: commands,
|
|
83
|
-
extraCommands: extraCommands,
|
|
84
|
-
commandOrchestrator: executeRef.current
|
|
85
|
-
}
|
|
86
|
-
}), {
|
|
87
|
-
ref: textRef
|
|
88
|
-
})) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
89
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Textarea["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
90
|
-
prefixCls: prefixCls
|
|
91
|
-
}, otherProps), {}, {
|
|
92
|
-
style: textStyle
|
|
93
|
-
}))
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
}
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _factory = require("./factory");
|
|
8
|
+
var _default = exports["default"] = (0, _factory.createTextArea)();
|
|
98
9
|
module.exports = exports.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import MDEditor from './Editor.common';
|
|
2
|
+
import * as commands from './commands/';
|
|
3
|
+
import * as MarkdownUtil from './utils/markdownUtils';
|
|
4
|
+
import './index.less';
|
|
5
|
+
export { headingExecute } from './commands/title';
|
|
6
|
+
export * from './commands/';
|
|
7
|
+
export * from './commands/group';
|
|
8
|
+
export * from './utils/markdownUtils';
|
|
9
|
+
export * from './utils/InsertTextAtPosition';
|
|
10
|
+
export * from './Editor.common';
|
|
11
|
+
export * from './Context';
|
|
12
|
+
export * from './Types';
|
|
13
|
+
export { default as handleKeyDown } from './components/TextArea/handleKeyDown';
|
|
14
|
+
export { default as shortcuts } from './components/TextArea/shortcuts';
|
|
15
|
+
export { MarkdownUtil, commands };
|
|
16
|
+
export default MDEditor;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
commands: true,
|
|
10
|
+
MarkdownUtil: true,
|
|
11
|
+
headingExecute: true,
|
|
12
|
+
handleKeyDown: true,
|
|
13
|
+
shortcuts: true
|
|
14
|
+
};
|
|
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
|
+
});
|
|
34
|
+
var _Editor = _interopRequireWildcard(require("./Editor.common"));
|
|
35
|
+
Object.keys(_Editor).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
38
|
+
if (key in exports && exports[key] === _Editor[key]) return;
|
|
39
|
+
Object.defineProperty(exports, key, {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function get() {
|
|
42
|
+
return _Editor[key];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
var commands = _interopRequireWildcard(require("./commands/"));
|
|
47
|
+
exports.commands = commands;
|
|
48
|
+
Object.keys(commands).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
51
|
+
if (key in exports && exports[key] === commands[key]) return;
|
|
52
|
+
Object.defineProperty(exports, key, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function get() {
|
|
55
|
+
return commands[key];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var MarkdownUtil = _interopRequireWildcard(require("./utils/markdownUtils"));
|
|
60
|
+
exports.MarkdownUtil = MarkdownUtil;
|
|
61
|
+
Object.keys(MarkdownUtil).forEach(function (key) {
|
|
62
|
+
if (key === "default" || key === "__esModule") return;
|
|
63
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
|
+
if (key in exports && exports[key] === MarkdownUtil[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function get() {
|
|
68
|
+
return MarkdownUtil[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _title = require("./commands/title");
|
|
73
|
+
var _group = require("./commands/group");
|
|
74
|
+
Object.keys(_group).forEach(function (key) {
|
|
75
|
+
if (key === "default" || key === "__esModule") return;
|
|
76
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
77
|
+
if (key in exports && exports[key] === _group[key]) return;
|
|
78
|
+
Object.defineProperty(exports, key, {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _group[key];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
var _InsertTextAtPosition = require("./utils/InsertTextAtPosition");
|
|
86
|
+
Object.keys(_InsertTextAtPosition).forEach(function (key) {
|
|
87
|
+
if (key === "default" || key === "__esModule") return;
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
89
|
+
if (key in exports && exports[key] === _InsertTextAtPosition[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _InsertTextAtPosition[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
var _Context = require("./Context");
|
|
98
|
+
Object.keys(_Context).forEach(function (key) {
|
|
99
|
+
if (key === "default" || key === "__esModule") return;
|
|
100
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
101
|
+
if (key in exports && exports[key] === _Context[key]) return;
|
|
102
|
+
Object.defineProperty(exports, key, {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _Context[key];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
var _Types = require("./Types");
|
|
110
|
+
Object.keys(_Types).forEach(function (key) {
|
|
111
|
+
if (key === "default" || key === "__esModule") return;
|
|
112
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
113
|
+
if (key in exports && exports[key] === _Types[key]) return;
|
|
114
|
+
Object.defineProperty(exports, key, {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function get() {
|
|
117
|
+
return _Types[key];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
var _handleKeyDown = _interopRequireDefault(require("./components/TextArea/handleKeyDown"));
|
|
122
|
+
var _shortcuts = _interopRequireDefault(require("./components/TextArea/shortcuts"));
|
|
123
|
+
var _default = exports["default"] = _Editor["default"];
|
package/markdown-editor.css
CHANGED
package/nohighlight.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ declare module '@uiw/react-md-editor/nohighlight' {
|
|
|
10
10
|
export * from '@uiw/react-md-editor/esm/Editor.nohighlight';
|
|
11
11
|
export * from '@uiw/react-md-editor/esm/Context';
|
|
12
12
|
export * from '@uiw/react-md-editor/esm/Types';
|
|
13
|
+
export { default as handleKeyDown } from '@uiw/react-md-editor/esm/components/TextArea/handleKeyDown';
|
|
14
|
+
export { default as shortcuts } from '@uiw/react-md-editor/esm/components/TextArea/shortcuts';
|
|
13
15
|
export { MarkdownUtil, commands };
|
|
14
16
|
export default MDEditor;
|
|
15
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uiw/react-md-editor",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
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",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"types": "./lib/index.d.ts",
|
|
17
17
|
"require": "./lib/index.js"
|
|
18
18
|
},
|
|
19
|
+
"./common": {
|
|
20
|
+
"import": "./esm/index.common.js",
|
|
21
|
+
"types": "./lib/index.common.d.ts",
|
|
22
|
+
"require": "./lib/index.common.js"
|
|
23
|
+
},
|
|
19
24
|
"./nohighlight": {
|
|
20
25
|
"import": "./esm/index.nohighlight.js",
|
|
21
26
|
"types": "./lib/index.nohighlight.d.ts",
|
|
@@ -41,6 +46,7 @@
|
|
|
41
46
|
},
|
|
42
47
|
"files": [
|
|
43
48
|
"markdown-editor.css",
|
|
49
|
+
"common.d.ts",
|
|
44
50
|
"nohighlight.d.ts",
|
|
45
51
|
"commands.d.ts",
|
|
46
52
|
"commands-cn.d.ts",
|
|
@@ -56,7 +62,7 @@
|
|
|
56
62
|
},
|
|
57
63
|
"dependencies": {
|
|
58
64
|
"@babel/runtime": "^7.14.6",
|
|
59
|
-
"@uiw/react-markdown-preview": "^5.0
|
|
65
|
+
"@uiw/react-markdown-preview": "^5.2.0",
|
|
60
66
|
"rehype": "~13.0.0",
|
|
61
67
|
"rehype-prism-plus": "~2.0.0"
|
|
62
68
|
},
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import MarkdownPreview from '@uiw/react-markdown-preview/common';
|
|
2
|
+
import TextArea from './components/TextArea/index.common';
|
|
3
|
+
import { createMDEditor } from './Editor.factory';
|
|
4
|
+
|
|
5
|
+
export type { RefMDEditor } from './Editor.factory';
|
|
6
|
+
|
|
7
|
+
export default createMDEditor({ MarkdownPreview, TextArea });
|