ronds-metadata 1.1.45 → 1.1.47
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.
@@ -10,6 +10,16 @@ interface IMdViewProps {
|
|
10
10
|
* 是否显示导航
|
11
11
|
*/
|
12
12
|
isMarkNav?: boolean;
|
13
|
+
navOptions?: {
|
14
|
+
/** Automatically update the hash value of browser address when page scrolling if true */
|
15
|
+
updateHashAuto?: boolean;
|
16
|
+
/** Use the text of the title from Markdown content as the hash value for the anchor if true */
|
17
|
+
declarative?: boolean;
|
18
|
+
/** The event callback function after clicking navbar item */
|
19
|
+
onNavItemClick?: (event: any, element: HTMLDivElement, hashValue: string) => void;
|
20
|
+
/** The event callback function before the hash value of browser address changing */
|
21
|
+
onHashChange?: (newHash: string, oldHash: string) => void;
|
22
|
+
};
|
13
23
|
}
|
14
24
|
declare const MdView: (props: IMdViewProps) => JSX.Element;
|
15
25
|
export default MdView;
|
package/es/comps/MdView/index.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
1
2
|
import React from "react";
|
2
3
|
|
3
4
|
/*
|
4
5
|
* @Author: wangxian
|
5
6
|
* @Date: 2022-09-02 16:17:38
|
6
|
-
* @LastEditTime: 2022-10-
|
7
|
+
* @LastEditTime: 2022-10-13 17:19:32
|
7
8
|
*/
|
8
9
|
import ReactMarkdown from 'react-markdown';
|
9
10
|
import remarkGfm from 'remark-gfm';
|
@@ -16,7 +17,8 @@ import './index.less';
|
|
16
17
|
var MdView = function MdView(props) {
|
17
18
|
var source = props.source,
|
18
19
|
_props$isMarkNav = props.isMarkNav,
|
19
|
-
isMarkNav = _props$isMarkNav === void 0 ? false : _props$isMarkNav
|
20
|
+
isMarkNav = _props$isMarkNav === void 0 ? false : _props$isMarkNav,
|
21
|
+
navOptions = props.navOptions;
|
20
22
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
21
23
|
className: "react-mark-down",
|
22
24
|
style: {
|
@@ -35,11 +37,11 @@ var MdView = function MdView(props) {
|
|
35
37
|
padding: '10px',
|
36
38
|
overflowY: 'auto'
|
37
39
|
}
|
38
|
-
}, /*#__PURE__*/React.createElement(MarkNav, {
|
40
|
+
}, /*#__PURE__*/React.createElement(MarkNav, _extends({
|
39
41
|
className: "h-full w-full",
|
40
42
|
source: source,
|
41
43
|
ordered: true
|
42
|
-
}))));
|
44
|
+
}, navOptions)))));
|
43
45
|
};
|
44
46
|
|
45
47
|
export default MdView;
|