@readme/markdown 6.66.0-beta.4 → 6.66.0-beta.6
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/components/Code/index.jsx +1 -1
- package/components/CodeTabs/index.jsx +8 -11
- package/components/Div.jsx +1 -1
- package/dist/main.js +28462 -147564
- package/dist/main.node.js +26324 -158245
- package/package.json +4 -4
|
@@ -78,7 +78,7 @@ function CreateCode({ copyButtons, theme }) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
Code.propTypes = {
|
|
81
|
-
children: PropTypes.arrayOf(PropTypes.string),
|
|
81
|
+
children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.string), PropTypes.string),
|
|
82
82
|
className: PropTypes.string,
|
|
83
83
|
copyButtons: PropTypes.bool,
|
|
84
84
|
lang: PropTypes.string,
|
|
@@ -4,19 +4,16 @@ const React = require('react');
|
|
|
4
4
|
const { useState } = require('react');
|
|
5
5
|
|
|
6
6
|
const traverseProps = (props, fn) => {
|
|
7
|
-
if (props
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
7
|
+
if (!props) return;
|
|
8
|
+
fn(props);
|
|
9
|
+
|
|
10
|
+
if (props && 'children' in props) {
|
|
11
|
+
if (Array.isArray(props.children)) {
|
|
12
|
+
props.children.forEach(child => child.props && traverseProps(child.props, fn));
|
|
14
13
|
} else {
|
|
15
|
-
|
|
14
|
+
traverseProps(props.children.props, fn);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
fn(props);
|
|
20
17
|
};
|
|
21
18
|
|
|
22
19
|
const CodeTabs = props => {
|
|
@@ -69,7 +66,7 @@ const CodeTabs = props => {
|
|
|
69
66
|
};
|
|
70
67
|
|
|
71
68
|
CodeTabs.propTypes = {
|
|
72
|
-
children: PropTypes.arrayOf(PropTypes.any).
|
|
69
|
+
children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.any), PropTypes.object),
|
|
73
70
|
theme: PropTypes.string,
|
|
74
71
|
};
|
|
75
72
|
|
package/components/Div.jsx
CHANGED
|
@@ -19,7 +19,7 @@ const Div = ({ components, ...props }) => {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
Div.propTypes = {
|
|
22
|
-
children: PropTypes.arrayOf(PropTypes.any),
|
|
22
|
+
children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.any), PropTypes.object),
|
|
23
23
|
className: PropTypes.string,
|
|
24
24
|
components: PropTypes.object,
|
|
25
25
|
};
|