@uiw/react-md-editor 3.25.6 → 4.0.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 +21 -11
- package/dist/mdeditor.css +1 -1
- package/dist/mdeditor.js +33885 -32579
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/dist/mdeditor.min.js.LICENSE.txt +0 -17
- package/esm/components/TextArea/Markdown.js +4 -1
- package/esm/components/TextArea/index.js +2 -2
- package/esm/components/TextArea/index.nohighlight.js +2 -2
- package/esm/components/Toolbar/index.css +1 -1
- package/esm/components/Toolbar/index.less +1 -1
- package/lib/components/TextArea/Markdown.js +4 -1
- package/lib/components/TextArea/index.js +2 -2
- package/lib/components/TextArea/index.nohighlight.js +2 -2
- package/lib/components/Toolbar/index.less +1 -1
- package/markdown-editor.css +1 -1
- package/package.json +3 -3
- package/src/components/TextArea/Markdown.tsx +2 -0
- package/src/components/Toolbar/index.less +1 -1
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Determine if an object is a Buffer
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @license React
|
|
10
|
-
* react-is.production.min.js
|
|
11
|
-
*
|
|
12
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the MIT license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
1
|
/**
|
|
19
2
|
* @license React
|
|
20
3
|
* react-jsx-runtime.production.min.js
|
|
@@ -49,7 +49,10 @@ export default function Markdown(props) {
|
|
|
49
49
|
try {
|
|
50
50
|
mdStr = rehype().data('settings', {
|
|
51
51
|
fragment: true
|
|
52
|
-
})
|
|
52
|
+
})
|
|
53
|
+
// https://github.com/uiwjs/react-md-editor/issues/593
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
.use(rehypePrism, {
|
|
53
56
|
ignoreMissing: true
|
|
54
57
|
}).processSync(mdStr).toString();
|
|
55
58
|
} catch (error) {}
|
|
@@ -66,7 +66,7 @@ export default function TextArea(props) {
|
|
|
66
66
|
style: {
|
|
67
67
|
minHeight
|
|
68
68
|
},
|
|
69
|
-
children: renderTextarea ? /*#__PURE__*/React.cloneElement(renderTextarea(_extends({}, otherProps, {
|
|
69
|
+
children: renderTextarea ? ( /*#__PURE__*/React.cloneElement(renderTextarea(_extends({}, otherProps, {
|
|
70
70
|
value: markdown,
|
|
71
71
|
autoComplete: 'off',
|
|
72
72
|
autoCorrect: 'off',
|
|
@@ -88,7 +88,7 @@ export default function TextArea(props) {
|
|
|
88
88
|
}
|
|
89
89
|
}), {
|
|
90
90
|
ref: textRef
|
|
91
|
-
}) : /*#__PURE__*/_jsxs(Fragment, {
|
|
91
|
+
})) : /*#__PURE__*/_jsxs(Fragment, {
|
|
92
92
|
children: [highlightEnable && /*#__PURE__*/_jsx(Markdown, {
|
|
93
93
|
prefixCls: prefixCls
|
|
94
94
|
}), /*#__PURE__*/_jsx(Textarea, _extends({
|
|
@@ -59,7 +59,7 @@ export default function TextArea(props) {
|
|
|
59
59
|
onScroll: onScroll,
|
|
60
60
|
children: /*#__PURE__*/_jsx("div", {
|
|
61
61
|
className: prefixCls + "-text",
|
|
62
|
-
children: renderTextarea ? /*#__PURE__*/React.cloneElement(renderTextarea(_extends({}, otherProps, {
|
|
62
|
+
children: renderTextarea ? ( /*#__PURE__*/React.cloneElement(renderTextarea(_extends({}, otherProps, {
|
|
63
63
|
value: markdown,
|
|
64
64
|
autoComplete: 'off',
|
|
65
65
|
autoCorrect: 'off',
|
|
@@ -81,7 +81,7 @@ export default function TextArea(props) {
|
|
|
81
81
|
}
|
|
82
82
|
}), {
|
|
83
83
|
ref: textRef
|
|
84
|
-
}) : /*#__PURE__*/_jsx(Fragment, {
|
|
84
|
+
})) : /*#__PURE__*/_jsx(Fragment, {
|
|
85
85
|
children: /*#__PURE__*/_jsx(Textarea, _extends({
|
|
86
86
|
prefixCls: prefixCls
|
|
87
87
|
}, otherProps, {
|
|
@@ -57,7 +57,10 @@ function Markdown(props) {
|
|
|
57
57
|
try {
|
|
58
58
|
mdStr = (0, _rehype.rehype)().data('settings', {
|
|
59
59
|
fragment: true
|
|
60
|
-
})
|
|
60
|
+
})
|
|
61
|
+
// https://github.com/uiwjs/react-md-editor/issues/593
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
.use(_rehypePrismPlus["default"], {
|
|
61
64
|
ignoreMissing: true
|
|
62
65
|
}).processSync(mdStr).toString();
|
|
63
66
|
} catch (error) {}
|
|
@@ -69,7 +69,7 @@ function TextArea(props) {
|
|
|
69
69
|
style: {
|
|
70
70
|
minHeight: minHeight
|
|
71
71
|
},
|
|
72
|
-
children: renderTextarea ? /*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
72
|
+
children: renderTextarea ? ( /*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
73
73
|
value: markdown,
|
|
74
74
|
autoComplete: 'off',
|
|
75
75
|
autoCorrect: 'off',
|
|
@@ -91,7 +91,7 @@ function TextArea(props) {
|
|
|
91
91
|
}
|
|
92
92
|
}), {
|
|
93
93
|
ref: textRef
|
|
94
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
94
|
+
})) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
95
95
|
children: [highlightEnable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Markdown["default"], {
|
|
96
96
|
prefixCls: prefixCls
|
|
97
97
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Textarea["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
@@ -63,7 +63,7 @@ function TextArea(props) {
|
|
|
63
63
|
onScroll: onScroll,
|
|
64
64
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
65
65
|
className: "".concat(prefixCls, "-text"),
|
|
66
|
-
children: renderTextarea ? /*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
66
|
+
children: renderTextarea ? ( /*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
67
67
|
value: markdown,
|
|
68
68
|
autoComplete: 'off',
|
|
69
69
|
autoCorrect: 'off',
|
|
@@ -85,7 +85,7 @@ function TextArea(props) {
|
|
|
85
85
|
}
|
|
86
86
|
}), {
|
|
87
87
|
ref: textRef
|
|
88
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
88
|
+
})) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
89
89
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Textarea["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
90
90
|
prefixCls: prefixCls
|
|
91
91
|
}, otherProps), {}, {
|
package/markdown-editor.css
CHANGED
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
.w-md-editor-toolbar {
|
|
170
170
|
border-bottom: 1px solid var(--md-editor-box-shadow-color);
|
|
171
171
|
background-color: var(--md-editor-background-color);
|
|
172
|
-
padding:
|
|
172
|
+
padding: 3px;
|
|
173
173
|
display: flex;
|
|
174
174
|
justify-content: space-between;
|
|
175
175
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uiw/react-md-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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
|
"author": "kenny wang <wowohoo@qq.com>",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.14.6",
|
|
52
|
-
"@uiw/react-markdown-preview": "^
|
|
53
|
-
"rehype": "~
|
|
52
|
+
"@uiw/react-markdown-preview": "^5.0.2",
|
|
53
|
+
"rehype": "~13.0.0",
|
|
54
54
|
"rehype-prism-plus": "~1.6.1"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
@@ -43,6 +43,8 @@ export default function Markdown(props: MarkdownProps) {
|
|
|
43
43
|
try {
|
|
44
44
|
mdStr = rehype()
|
|
45
45
|
.data('settings', { fragment: true })
|
|
46
|
+
// https://github.com/uiwjs/react-md-editor/issues/593
|
|
47
|
+
// @ts-ignore
|
|
46
48
|
.use(rehypePrism, { ignoreMissing: true })
|
|
47
49
|
.processSync(mdStr)
|
|
48
50
|
.toString();
|