@uiw/react-md-editor 3.14.1 → 3.14.4
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 +22 -27
- package/dist/mdeditor.css +20 -11
- package/dist/mdeditor.js +772 -913
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/esm/commands/bold.js +1 -1
- package/esm/commands/bold.js.map +2 -2
- package/esm/components/TextArea/Markdown.js +31 -24
- package/esm/components/TextArea/Markdown.js.map +12 -9
- package/esm/components/TextArea/index.js +3 -3
- package/esm/components/TextArea/index.js.map +4 -4
- package/esm/index.css +4 -0
- package/esm/index.less +6 -0
- package/lib/Context.js +3 -3
- package/lib/Context.js.map +1 -1
- package/lib/Editor.js +19 -19
- package/lib/Editor.js.map +1 -1
- package/lib/commands/bold.js +2 -2
- package/lib/commands/bold.js.map +1 -1
- package/lib/commands/code.js +1 -1
- package/lib/commands/fullscreen.js +1 -1
- package/lib/commands/group.js +4 -4
- package/lib/commands/group.js.map +1 -1
- package/lib/commands/hr.js +1 -1
- package/lib/commands/image.js +1 -1
- package/lib/commands/index.js +8 -8
- package/lib/commands/italic.js +1 -1
- package/lib/commands/link.js +1 -1
- package/lib/commands/list.js +1 -1
- package/lib/commands/preview.js +1 -1
- package/lib/commands/quote.js +1 -1
- package/lib/commands/strikeThrough.js +1 -1
- package/lib/commands/title.js +2 -2
- package/lib/commands/title.js.map +1 -1
- package/lib/commands/title1.js +1 -1
- package/lib/commands/title2.js +1 -1
- package/lib/commands/title3.js +1 -1
- package/lib/commands/title4.js +1 -1
- package/lib/commands/title5.js +1 -1
- package/lib/commands/title6.js +1 -1
- package/lib/components/DragBar/index.js +3 -3
- package/lib/components/TextArea/Markdown.js +39 -33
- package/lib/components/TextArea/Markdown.js.map +12 -9
- package/lib/components/TextArea/Textarea.js +10 -10
- package/lib/components/TextArea/Textarea.js.map +1 -1
- package/lib/components/TextArea/handleKeyDown.js +1 -1
- package/lib/components/TextArea/index.js +15 -15
- package/lib/components/TextArea/index.js.map +4 -4
- package/lib/components/TextArea/shortcuts.js +3 -3
- package/lib/components/TextArea/shortcuts.js.map +1 -1
- package/lib/components/Toolbar/Child.js +4 -4
- package/lib/components/Toolbar/Child.js.map +1 -1
- package/lib/components/Toolbar/index.js +11 -11
- package/lib/components/Toolbar/index.js.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/index.less +6 -0
- package/lib/utils/InsertTextAtPosition.js +2 -2
- package/lib/utils/InsertTextAtPosition.js.map +1 -1
- package/markdown-editor.css +4 -0
- package/package.json +2 -60
- package/src/commands/bold.tsx +1 -1
- package/src/components/TextArea/Markdown.tsx +31 -24
- package/src/components/TextArea/index.tsx +1 -2
- package/src/index.less +6 -0
- package/LICENSE +0 -21
- package/src/tsconfig.json +0 -8
package/lib/commands/hr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/image.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -234,8 +234,8 @@ function getStateFromTextArea(textArea) {
|
|
|
234
234
|
|
|
235
235
|
var TextAreaTextApi = /*#__PURE__*/function () {
|
|
236
236
|
function TextAreaTextApi(textArea) {
|
|
237
|
-
(0, _classCallCheck2
|
|
238
|
-
(0, _defineProperty2
|
|
237
|
+
(0, _classCallCheck2["default"])(this, TextAreaTextApi);
|
|
238
|
+
(0, _defineProperty2["default"])(this, "textArea", void 0);
|
|
239
239
|
this.textArea = textArea;
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
@@ -245,7 +245,7 @@ var TextAreaTextApi = /*#__PURE__*/function () {
|
|
|
245
245
|
*/
|
|
246
246
|
|
|
247
247
|
|
|
248
|
-
(0, _createClass2
|
|
248
|
+
(0, _createClass2["default"])(TextAreaTextApi, [{
|
|
249
249
|
key: "replaceSelection",
|
|
250
250
|
value: function replaceSelection(text) {
|
|
251
251
|
(0, _InsertTextAtPosition.insertTextAtPosition)(this.textArea, text);
|
|
@@ -272,14 +272,14 @@ exports.TextAreaTextApi = TextAreaTextApi;
|
|
|
272
272
|
|
|
273
273
|
var TextAreaCommandOrchestrator = /*#__PURE__*/function () {
|
|
274
274
|
function TextAreaCommandOrchestrator(textArea) {
|
|
275
|
-
(0, _classCallCheck2
|
|
276
|
-
(0, _defineProperty2
|
|
277
|
-
(0, _defineProperty2
|
|
275
|
+
(0, _classCallCheck2["default"])(this, TextAreaCommandOrchestrator);
|
|
276
|
+
(0, _defineProperty2["default"])(this, "textArea", void 0);
|
|
277
|
+
(0, _defineProperty2["default"])(this, "textApi", void 0);
|
|
278
278
|
this.textArea = textArea;
|
|
279
279
|
this.textApi = new TextAreaTextApi(textArea);
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
(0, _createClass2
|
|
282
|
+
(0, _createClass2["default"])(TextAreaCommandOrchestrator, [{
|
|
283
283
|
key: "getState",
|
|
284
284
|
value: function getState() {
|
|
285
285
|
if (!this.textArea) return false;
|
package/lib/commands/italic.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/link.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/list.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/preview.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/quote.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/title.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -15,7 +15,7 @@ var _title = require("./title2");
|
|
|
15
15
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
|
|
18
|
-
var title = (0, _objectSpread2
|
|
18
|
+
var title = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _title.title2), {}, {
|
|
19
19
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
20
20
|
width: "12",
|
|
21
21
|
height: "12",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"sourcesContent": [
|
|
12
12
|
"import React from 'react';\nimport { ICommand } from './';\nimport { title2 } from './title2';\n\nexport const title: ICommand = {\n ...title2,\n icon: (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 520 520\">\n <path\n fill=\"currentColor\"\n d=\"M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z\"\n />\n </svg>\n ),\n};\n"
|
|
13
13
|
],
|
|
14
|
-
"mappings": ";;;;;;;;;;;AAAA;;AAEA;;;;AAEO,IAAMA,KAAe
|
|
14
|
+
"mappings": ";;;;;;;;;;;AAAA;;AAEA;;;;AAEO,IAAMA,KAAe,qEACvBC,aADuB;EAE1BC,IAAI,eACF;IAAK,KAAK,EAAC,IAAX;IAAgB,MAAM,EAAC,IAAvB;IAA4B,OAAO,EAAC,aAApC;IAAA,uBACE;MACE,IAAI,EAAC,cADP;MAEE,CAAC,EAAC;IAFJ;EADF;AAHwB,EAArB"
|
|
15
15
|
}
|
package/lib/commands/title1.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/title2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/title3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/title4.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/title5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
package/lib/commands/title6.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports["default"] = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -70,6 +70,6 @@ var DragBar = function DragBar(props) {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
var _default = DragBar;
|
|
73
|
-
exports
|
|
73
|
+
exports["default"] = _default;
|
|
74
74
|
module.exports = exports.default;
|
|
75
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports
|
|
10
|
+
exports["default"] = Markdown;
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
@@ -19,15 +19,36 @@ var _Context = require("../../Context");
|
|
|
19
19
|
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
22
|
+
function html2Escape(sHtml) {
|
|
23
|
+
return sHtml.replace(/```(tsx?|jsx?|html|xml)(.*)\s+([\s\S]*?)(\s.+)?```/g, function (str) {
|
|
24
|
+
return str.replace(/[<&"]/g, function (c) {
|
|
25
|
+
return {
|
|
26
|
+
'<': '<',
|
|
27
|
+
'>': '>',
|
|
28
|
+
'&': '&',
|
|
29
|
+
'"': '"'
|
|
30
|
+
}[c];
|
|
31
|
+
});
|
|
32
|
+
}).replace(/[<&"]/g, function (c) {
|
|
33
|
+
return {
|
|
34
|
+
'<': '<',
|
|
35
|
+
'>': '>',
|
|
36
|
+
'&': '&',
|
|
37
|
+
'"': '"'
|
|
38
|
+
}[c];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
22
42
|
function Markdown(props) {
|
|
23
43
|
var prefixCls = props.prefixCls;
|
|
24
44
|
|
|
25
45
|
var _useContext = (0, _react.useContext)(_Context.EditorContext),
|
|
26
46
|
_useContext$markdown = _useContext.markdown,
|
|
27
47
|
markdown = _useContext$markdown === void 0 ? '' : _useContext$markdown,
|
|
48
|
+
highlightEnable = _useContext.highlightEnable,
|
|
28
49
|
dispatch = _useContext.dispatch;
|
|
29
50
|
|
|
30
|
-
var preRef = /*#__PURE__*/_react
|
|
51
|
+
var preRef = /*#__PURE__*/_react["default"].createRef();
|
|
31
52
|
|
|
32
53
|
(0, _react.useEffect)(function () {
|
|
33
54
|
if (preRef.current && dispatch) {
|
|
@@ -37,45 +58,30 @@ function Markdown(props) {
|
|
|
37
58
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
59
|
|
|
39
60
|
}, []);
|
|
40
|
-
|
|
41
|
-
function html2Escape(sHtml) {
|
|
42
|
-
return sHtml.replace(/```(tsx?|jsx?|html|xml)(.*)\s+([\s\S]*?)(\s.+)?```/g, function (str) {
|
|
43
|
-
return str.replace(/[<&"]/g, function (c) {
|
|
44
|
-
return {
|
|
45
|
-
'<': '<',
|
|
46
|
-
'>': '>',
|
|
47
|
-
'&': '&',
|
|
48
|
-
'"': '"'
|
|
49
|
-
}[c];
|
|
50
|
-
});
|
|
51
|
-
}).replace(/[<&"]/g, function (c) {
|
|
52
|
-
return {
|
|
53
|
-
'<': '<',
|
|
54
|
-
'>': '>',
|
|
55
|
-
'&': '&',
|
|
56
|
-
'"': '"'
|
|
57
|
-
}[c];
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
61
|
return (0, _react.useMemo)(function () {
|
|
62
62
|
if (!markdown) {
|
|
63
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("pre", {
|
|
64
|
-
children: markdown || '',
|
|
65
64
|
ref: preRef,
|
|
66
65
|
className: "".concat(prefixCls, "-text-pre wmde-markdown-color")
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
var mdStr = "<pre class=\"language-markdown ".concat(prefixCls, "-text-pre wmde-markdown-color\"><code class=\"language-markdown\">").concat(html2Escape(markdown), "\n</code></pre>");
|
|
70
|
+
|
|
71
|
+
if (highlightEnable) {
|
|
72
|
+
try {
|
|
73
|
+
mdStr = (0, _rehype.rehype)().data('settings', {
|
|
74
|
+
fragment: true
|
|
75
|
+
}).use(_rehypePrismPlus["default"], {
|
|
76
|
+
ignoreMissing: true
|
|
77
|
+
}).processSync(mdStr).toString();
|
|
78
|
+
} catch (error) {}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return /*#__PURE__*/_react["default"].createElement('div', {
|
|
76
82
|
className: 'wmde-markdown-color',
|
|
77
83
|
dangerouslySetInnerHTML: {
|
|
78
|
-
__html:
|
|
84
|
+
__html: mdStr || ''
|
|
79
85
|
}
|
|
80
86
|
});
|
|
81
87
|
}, [markdown, preRef, prefixCls]);
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"names": [
|
|
4
|
+
"html2Escape",
|
|
5
|
+
"sHtml",
|
|
6
|
+
"replace",
|
|
7
|
+
"str",
|
|
8
|
+
"c",
|
|
4
9
|
"Markdown",
|
|
5
10
|
"props",
|
|
6
11
|
"prefixCls",
|
|
7
12
|
"useContext",
|
|
8
13
|
"EditorContext",
|
|
9
14
|
"markdown",
|
|
15
|
+
"highlightEnable",
|
|
10
16
|
"dispatch",
|
|
11
17
|
"preRef",
|
|
12
18
|
"React",
|
|
@@ -14,12 +20,8 @@
|
|
|
14
20
|
"useEffect",
|
|
15
21
|
"current",
|
|
16
22
|
"textareaPre",
|
|
17
|
-
"html2Escape",
|
|
18
|
-
"sHtml",
|
|
19
|
-
"replace",
|
|
20
|
-
"str",
|
|
21
|
-
"c",
|
|
22
23
|
"useMemo",
|
|
24
|
+
"mdStr",
|
|
23
25
|
"rehype",
|
|
24
26
|
"data",
|
|
25
27
|
"fragment",
|
|
@@ -27,17 +29,18 @@
|
|
|
27
29
|
"rehypePrism",
|
|
28
30
|
"ignoreMissing",
|
|
29
31
|
"processSync",
|
|
32
|
+
"toString",
|
|
33
|
+
"error",
|
|
30
34
|
"createElement",
|
|
31
35
|
"className",
|
|
32
36
|
"dangerouslySetInnerHTML",
|
|
33
|
-
"__html"
|
|
34
|
-
"value"
|
|
37
|
+
"__html"
|
|
35
38
|
],
|
|
36
39
|
"sources": [
|
|
37
40
|
"../../../src/components/TextArea/Markdown.tsx"
|
|
38
41
|
],
|
|
39
42
|
"sourcesContent": [
|
|
40
|
-
"import React, { useContext, useEffect, useMemo } from 'react';\nimport { rehype } from 'rehype';\nimport rehypePrism from 'rehype-prism-plus';\nimport { IProps } from '../../Editor';\nimport { EditorContext } from '../../Context';\n\
|
|
43
|
+
"import React, { useContext, useEffect, useMemo } from 'react';\nimport { rehype } from 'rehype';\nimport rehypePrism from 'rehype-prism-plus';\nimport { IProps } from '../../Editor';\nimport { EditorContext } from '../../Context';\n\nfunction html2Escape(sHtml: string) {\n return sHtml\n .replace(/```(tsx?|jsx?|html|xml)(.*)\\s+([\\s\\S]*?)(\\s.+)?```/g, (str: string) => {\n return str.replace(\n /[<&\"]/g,\n (c: string) => (({ '<': '<', '>': '>', '&': '&', '\"': '"' } as Record<string, string>)[c]),\n );\n })\n .replace(\n /[<&\"]/g,\n (c: string) => (({ '<': '<', '>': '>', '&': '&', '\"': '"' } as Record<string, string>)[c]),\n );\n}\n\nexport interface MarkdownProps extends IProps, React.HTMLAttributes<HTMLPreElement> {}\n\nexport default function Markdown(props: MarkdownProps) {\n const { prefixCls } = props;\n const { markdown = '', highlightEnable, dispatch } = useContext(EditorContext);\n const preRef = React.createRef<HTMLPreElement>();\n useEffect(() => {\n if (preRef.current && dispatch) {\n dispatch({ textareaPre: preRef.current });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return useMemo(() => {\n if (!markdown) {\n return <pre ref={preRef} className={`${prefixCls}-text-pre wmde-markdown-color`} />;\n }\n let mdStr = `<pre class=\"language-markdown ${prefixCls}-text-pre wmde-markdown-color\"><code class=\"language-markdown\">${html2Escape(\n markdown,\n )}\\n</code></pre>`;\n\n if (highlightEnable) {\n try {\n mdStr = rehype()\n .data('settings', { fragment: true })\n .use(rehypePrism, { ignoreMissing: true })\n .processSync(mdStr)\n .toString();\n } catch (error) {}\n }\n\n return React.createElement('div', {\n className: 'wmde-markdown-color',\n dangerouslySetInnerHTML: { __html: mdStr || '' },\n });\n }, [markdown, preRef, prefixCls]);\n}\n"
|
|
41
44
|
],
|
|
42
|
-
"mappings": ";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;
|
|
45
|
+
"mappings": ";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;AAEA,SAASA,WAAT,CAAqBC,KAArB,EAAoC;EAClC,OAAOA,KAAK,CACTC,OADI,CACI,qDADJ,EAC2D,UAACC,GAAD,EAAiB;IAC/E,OAAOA,GAAG,CAACD,OAAJ,CACL,QADK,EAEL,UAACE,CAAD;MAAA,OAAiB;QAAE,KAAK,MAAP;QAAe,KAAK,MAApB;QAA4B,KAAK,OAAjC;QAA0C,KAAK;MAA/C,CAAD,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AND,CAME,OAAOC,KAAP,EAAc,CAAE;IACnB;;IAED,oBAAOf,iBAAA,CAAMgB,aAAN,CAAoB,KAApB,EAA2B;MAChCC,SAAS,EAAE,qBADqB;MAEhCC,uBAAuB,EAAE;QAAEC,MAAM,EAAEb,KAAK,IAAI;MAAnB;IAFO,CAA3B,CAAP;EAID,CAtBM,EAsBJ,CAACV,QAAD,EAAWG,MAAX,EAAmBN,SAAnB,CAtBI,CAAP;AAuBD"
|
|
43
46
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports
|
|
10
|
+
exports["default"] = Textarea;
|
|
11
11
|
|
|
12
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
13
|
|
|
@@ -32,7 +32,7 @@ var _excluded = ["prefixCls", "onChange"];
|
|
|
32
32
|
function Textarea(props) {
|
|
33
33
|
var prefixCls = props.prefixCls,
|
|
34
34
|
_onChange = props.onChange,
|
|
35
|
-
other = (0, _objectWithoutProperties2
|
|
35
|
+
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
36
36
|
|
|
37
37
|
var _useContext = (0, _react.useContext)(_Context.EditorContext),
|
|
38
38
|
markdown = _useContext.markdown,
|
|
@@ -45,11 +45,11 @@ function Textarea(props) {
|
|
|
45
45
|
defaultTabEnable = _useContext.defaultTabEnable,
|
|
46
46
|
dispatch = _useContext.dispatch;
|
|
47
47
|
|
|
48
|
-
var textRef = _react
|
|
48
|
+
var textRef = _react["default"].useRef(null);
|
|
49
49
|
|
|
50
|
-
var executeRef = _react
|
|
50
|
+
var executeRef = _react["default"].useRef();
|
|
51
51
|
|
|
52
|
-
var statesRef = _react
|
|
52
|
+
var statesRef = _react["default"].useRef({
|
|
53
53
|
fullscreen: fullscreen,
|
|
54
54
|
preview: preview
|
|
55
55
|
});
|
|
@@ -74,8 +74,8 @@ function Textarea(props) {
|
|
|
74
74
|
}, []);
|
|
75
75
|
|
|
76
76
|
var onKeyDown = function onKeyDown(e) {
|
|
77
|
-
(0, _handleKeyDown
|
|
78
|
-
(0, _shortcuts
|
|
77
|
+
(0, _handleKeyDown["default"])(e, tabSize, defaultTabEnable);
|
|
78
|
+
(0, _shortcuts["default"])(e, [].concat((0, _toConsumableArray2["default"])(commands || []), (0, _toConsumableArray2["default"])(extraCommands || [])), executeRef.current, dispatch, statesRef.current);
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
(0, _react.useEffect)(function () {
|
|
@@ -90,7 +90,7 @@ function Textarea(props) {
|
|
|
90
90
|
}
|
|
91
91
|
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
92
92
|
}, []);
|
|
93
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", (0, _objectSpread2
|
|
93
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
94
94
|
autoComplete: "off",
|
|
95
95
|
autoCorrect: "off",
|
|
96
96
|
autoCapitalize: "off",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"sourcesContent": [
|
|
44
44
|
"import React, { useContext, useEffect } from 'react';\nimport { IProps } from '../../Editor';\nimport { EditorContext, ExecuteCommandState } from '../../Context';\nimport { TextAreaCommandOrchestrator } from '../../commands';\nimport handleKeyDown from './handleKeyDown';\nimport shortcuts from './shortcuts';\nimport './index.less';\n\nexport interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value'>, IProps {}\n\nexport default function Textarea(props: TextAreaProps) {\n const { prefixCls, onChange, ...other } = props;\n const {\n markdown,\n commands,\n fullscreen,\n preview,\n highlightEnable,\n extraCommands,\n tabSize,\n defaultTabEnable,\n dispatch,\n } = useContext(EditorContext);\n const textRef = React.useRef<HTMLTextAreaElement>(null);\n const executeRef = React.useRef<TextAreaCommandOrchestrator>();\n const statesRef = React.useRef<ExecuteCommandState>({ fullscreen, preview });\n\n useEffect(() => {\n statesRef.current = { fullscreen, preview, highlightEnable };\n }, [fullscreen, preview, highlightEnable]);\n\n useEffect(() => {\n if (textRef.current && dispatch) {\n const commandOrchestrator = new TextAreaCommandOrchestrator(textRef.current);\n executeRef.current = commandOrchestrator;\n dispatch({ textarea: textRef.current, commandOrchestrator });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const onKeyDown = (e: KeyboardEvent | React.KeyboardEvent<HTMLTextAreaElement>) => {\n handleKeyDown(e, tabSize, defaultTabEnable);\n shortcuts(e, [...(commands || []), ...(extraCommands || [])], executeRef.current, dispatch, statesRef.current);\n };\n useEffect(() => {\n if (textRef.current) {\n textRef.current.addEventListener('keydown', onKeyDown);\n }\n return () => {\n if (textRef.current) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n textRef.current.removeEventListener('keydown', onKeyDown);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <textarea\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck={false}\n {...other}\n ref={textRef}\n className={`${prefixCls}-text-input ${other.className ? other.className : ''}`}\n value={markdown}\n onChange={(e) => {\n dispatch && dispatch({ markdown: e.target.value });\n onChange && onChange(e);\n }}\n />\n );\n}\n"
|
|
45
45
|
],
|
|
46
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAKe,SAASA,QAAT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kBAACoB,CAAD,EAAO;MACfZ,QAAQ,IAAIA,QAAQ,CAAC;QAAER,QAAQ,EAAEoB,CAAC,CAACM,MAAF,CAASC;MAArB,CAAD,CAApB;MACA/B,SAAQ,IAAIA,SAAQ,CAACwB,CAAD,CAApB;IACD;EAZH,GADF;AAgBD"
|
|
47
47
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports
|
|
10
|
+
exports["default"] = TextArea;
|
|
11
11
|
|
|
12
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
13
|
|
|
@@ -35,7 +35,7 @@ function TextArea(props) {
|
|
|
35
35
|
className = _ref.className,
|
|
36
36
|
onScroll = _ref.onScroll,
|
|
37
37
|
renderTextarea = _ref.renderTextarea,
|
|
38
|
-
otherProps = (0, _objectWithoutProperties2
|
|
38
|
+
otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
39
39
|
|
|
40
40
|
var _useContext = (0, _react.useContext)(_Context.EditorContext),
|
|
41
41
|
markdown = _useContext.markdown,
|
|
@@ -45,11 +45,11 @@ function TextArea(props) {
|
|
|
45
45
|
extraCommands = _useContext.extraCommands,
|
|
46
46
|
dispatch = _useContext.dispatch;
|
|
47
47
|
|
|
48
|
-
var textRef = _react
|
|
48
|
+
var textRef = _react["default"].useRef(null);
|
|
49
49
|
|
|
50
|
-
var executeRef = _react
|
|
50
|
+
var executeRef = _react["default"].useRef();
|
|
51
51
|
|
|
52
|
-
var warp = /*#__PURE__*/_react
|
|
52
|
+
var warp = /*#__PURE__*/_react["default"].createRef();
|
|
53
53
|
|
|
54
54
|
(0, _react.useEffect)(function () {
|
|
55
55
|
var state = {};
|
|
@@ -60,7 +60,7 @@ function TextArea(props) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (dispatch) {
|
|
63
|
-
dispatch((0, _objectSpread2
|
|
63
|
+
dispatch((0, _objectSpread2["default"])({}, state));
|
|
64
64
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
65
|
|
|
66
66
|
}, []);
|
|
@@ -75,10 +75,10 @@ function TextArea(props) {
|
|
|
75
75
|
});
|
|
76
76
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
77
|
|
|
78
|
-
}, []);
|
|
79
|
-
|
|
78
|
+
}, []);
|
|
80
79
|
var textStyle = highlightEnable ? {} : {
|
|
81
|
-
|
|
80
|
+
WebkitTextFillColor: 'initial',
|
|
81
|
+
overflow: 'auto'
|
|
82
82
|
};
|
|
83
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
84
84
|
ref: warp,
|
|
@@ -86,7 +86,7 @@ function TextArea(props) {
|
|
|
86
86
|
onScroll: onScroll,
|
|
87
87
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
88
88
|
className: "".concat(prefixCls, "-text"),
|
|
89
|
-
children: renderTextarea ? /*#__PURE__*/_react
|
|
89
|
+
children: renderTextarea ? /*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
|
|
90
90
|
value: markdown,
|
|
91
91
|
autoComplete: 'off',
|
|
92
92
|
autoCorrect: 'off',
|
|
@@ -100,7 +100,7 @@ function TextArea(props) {
|
|
|
100
100
|
}), {
|
|
101
101
|
dispatch: dispatch,
|
|
102
102
|
onChange: otherProps.onChange,
|
|
103
|
-
shortcuts: _shortcuts
|
|
103
|
+
shortcuts: _shortcuts["default"],
|
|
104
104
|
useContext: {
|
|
105
105
|
commands: commands,
|
|
106
106
|
extraCommands: extraCommands,
|
|
@@ -109,9 +109,9 @@ function TextArea(props) {
|
|
|
109
109
|
}), {
|
|
110
110
|
ref: textRef
|
|
111
111
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
112
|
-
children: [highlightEnable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Markdown
|
|
112
|
+
children: [highlightEnable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Markdown["default"], {
|
|
113
113
|
prefixCls: prefixCls
|
|
114
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Textarea
|
|
114
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Textarea["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
115
115
|
prefixCls: prefixCls
|
|
116
116
|
}, otherProps), {}, {
|
|
117
117
|
style: textStyle
|