ronds-metadata 1.1.61 → 1.1.62
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/es/comps/MdView/index.js
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
+
var _excluded = ["node", "inline", "className", "children"];
|
2
4
|
import React from "react";
|
3
5
|
|
4
6
|
/*
|
5
7
|
* @Author: wangxian
|
6
8
|
* @Date: 2022-09-02 16:17:38
|
7
|
-
* @LastEditTime: 2022-
|
9
|
+
* @LastEditTime: 2022-11-22 16:55:15
|
8
10
|
*/
|
9
11
|
import ReactMarkdown from 'react-markdown';
|
10
12
|
import remarkGfm from 'remark-gfm';
|
11
13
|
import rehypeRaw from 'rehype-raw';
|
12
14
|
import 'github-markdown-css';
|
15
|
+
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
|
16
|
+
import { oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
13
17
|
import './index.less';
|
14
18
|
import MdNavbar from '../MdNavbar';
|
15
19
|
|
@@ -28,7 +32,26 @@ var MdView = function MdView(props) {
|
|
28
32
|
className: "markdown-body react-mark-down"
|
29
33
|
}, /*#__PURE__*/React.createElement(ReactMarkdown, {
|
30
34
|
remarkPlugins: [remarkGfm],
|
31
|
-
rehypePlugins: [rehypeRaw]
|
35
|
+
rehypePlugins: [rehypeRaw],
|
36
|
+
components: {
|
37
|
+
code: function code(_ref) {
|
38
|
+
var node = _ref.node,
|
39
|
+
inline = _ref.inline,
|
40
|
+
className = _ref.className,
|
41
|
+
children = _ref.children,
|
42
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
43
|
+
|
44
|
+
var match = /language-(\w+)/.exec(className || '');
|
45
|
+
return !inline && match ? /*#__PURE__*/React.createElement(SyntaxHighlighter, _extends({
|
46
|
+
showLineNumbers: true,
|
47
|
+
style: oneLight,
|
48
|
+
language: match[1],
|
49
|
+
PreTag: "div"
|
50
|
+
}, props), String(children).replace(/\n$/, '')) : /*#__PURE__*/React.createElement("code", _extends({
|
51
|
+
className: className
|
52
|
+
}, props), children);
|
53
|
+
}
|
54
|
+
}
|
32
55
|
}, source)), isMarkNav && /*#__PURE__*/React.createElement("div", {
|
33
56
|
style: {
|
34
57
|
width: '250px',
|
@@ -26,7 +26,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
26
26
|
/*
|
27
27
|
* @Author:wangxian
|
28
28
|
* @Date: 2021-09-18 14:15:04
|
29
|
-
* @LastEditTime: 2022-11-22
|
29
|
+
* @LastEditTime: 2022-11-22 16:10:55
|
30
30
|
*/
|
31
31
|
import React from 'react';
|
32
32
|
import { MetadataFormContext, MetadataRefContext } from '../interface';
|
@@ -35,7 +35,7 @@ import { MetadataService } from '../../../framework/metadata/MetadataService';
|
|
35
35
|
import { deepClone } from '../../../utils';
|
36
36
|
import { useAsyncMemo } from '../../../framework/hooks/use-async-memo';
|
37
37
|
import { tr } from '../../../framework/locale';
|
38
|
-
import useObservable from '
|
38
|
+
import useObservable from '../../../framework/rxjs-hooks/useObservable';
|
39
39
|
|
40
40
|
function Index(props) {
|
41
41
|
var _extraInfo$http6, _extraInfo$http7, _extraInfo$http8, _extraInfo$http9;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"public": true,
|
3
3
|
"name": "ronds-metadata",
|
4
|
-
"version": "1.1.
|
4
|
+
"version": "1.1.62",
|
5
5
|
"scripts": {
|
6
6
|
"start": "dumi dev",
|
7
7
|
"docs:build": "dumi build",
|
@@ -55,6 +55,7 @@
|
|
55
55
|
"react-markdown": "^8.0.3",
|
56
56
|
"react-markdown-editor-lite": "^1.3.2",
|
57
57
|
"react-popper": "^2.2.3",
|
58
|
+
"react-syntax-highlighter": "^15.5.0",
|
58
59
|
"rehype-raw": "^6.1.1",
|
59
60
|
"remark-gfm": "^3.0.1",
|
60
61
|
"rxjs": "^7.5.4"
|