@readme/markdown 6.66.0-beta.5 → 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.
@@ -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?.children) {
8
- if (props.children.forEach) {
9
- props.children.forEach(child => {
10
- if (child.props) {
11
- traverseProps(child.props, fn);
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
- fn(props.children.props);
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).isRequired,
69
+ children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.any), PropTypes.object),
73
70
  theme: PropTypes.string,
74
71
  };
75
72
 
@@ -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
  };
package/dist/main.js CHANGED
@@ -7625,7 +7625,7 @@ function CreateCode(_ref2) {
7625
7625
  };
7626
7626
  }
7627
7627
  Code.propTypes = {
7628
- children: PropTypes.arrayOf(PropTypes.string),
7628
+ children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.string), PropTypes.string),
7629
7629
  className: PropTypes.string,
7630
7630
  copyButtons: PropTypes.bool,
7631
7631
  lang: PropTypes.string,
@@ -7659,18 +7659,17 @@ var React = __webpack_require__(3634);
7659
7659
  var _require2 = __webpack_require__(3634),
7660
7660
  useState = _require2.useState;
7661
7661
  var traverseProps = function traverseProps(props, fn) {
7662
- if (props !== null && props !== void 0 && props.children) {
7663
- if (props.children.forEach) {
7662
+ if (!props) return;
7663
+ fn(props);
7664
+ if (props && 'children' in props) {
7665
+ if (Array.isArray(props.children)) {
7664
7666
  props.children.forEach(function (child) {
7665
- if (child.props) {
7666
- traverseProps(child.props, fn);
7667
- }
7667
+ return child.props && traverseProps(child.props, fn);
7668
7668
  });
7669
7669
  } else {
7670
- fn(props.children.props);
7670
+ traverseProps(props.children.props, fn);
7671
7671
  }
7672
7672
  }
7673
- fn(props);
7674
7673
  };
7675
7674
  var CodeTabs = function CodeTabs(props) {
7676
7675
  var children = props.children,
@@ -7725,7 +7724,7 @@ var CodeTabs = function CodeTabs(props) {
7725
7724
  }, children));
7726
7725
  };
7727
7726
  CodeTabs.propTypes = {
7728
- children: PropTypes.arrayOf(PropTypes.any).isRequired,
7727
+ children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.any), PropTypes.object),
7729
7728
  theme: PropTypes.string
7730
7729
  };
7731
7730
  function CreateCodeTabs(_ref3) {
@@ -7774,7 +7773,7 @@ var Div = function Div(_ref) {
7774
7773
  return /*#__PURE__*/React.createElement("div", props);
7775
7774
  };
7776
7775
  Div.propTypes = {
7777
- children: PropTypes.arrayOf(PropTypes.any),
7776
+ children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.any), PropTypes.object),
7778
7777
  className: PropTypes.string,
7779
7778
  components: PropTypes.object
7780
7779
  };
@@ -36717,7 +36716,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
36717
36716
  /* eslint-disable no-param-reassign */
36718
36717
 
36719
36718
  __webpack_require__(2787);
36720
- var MDXRuntime = (__webpack_require__(2114)["default"]);
36719
+ var Mdx = (__webpack_require__(2114)["default"]);
36721
36720
  var Variable = __webpack_require__(1882);
36722
36721
  var generateTOC = __webpack_require__(3263);
36723
36722
  var React = __webpack_require__(3634);
@@ -36937,7 +36936,7 @@ function react(content) {
36937
36936
  })), transformers, [remarkSlug, [remarkDisableTokenizers, opts.disableTokenizers]]);
36938
36937
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
36939
36938
  key: content
36940
- }, /*#__PURE__*/React.createElement(MDXRuntime, {
36939
+ }, /*#__PURE__*/React.createElement(Mdx, {
36941
36940
  components: reactComponents(opts, components),
36942
36941
  rehypePlugins: [sectionAnchorId],
36943
36942
  remarkPlugins: remarkPlugins
package/dist/main.node.js CHANGED
@@ -7625,7 +7625,7 @@ function CreateCode(_ref2) {
7625
7625
  };
7626
7626
  }
7627
7627
  Code.propTypes = {
7628
- children: PropTypes.arrayOf(PropTypes.string),
7628
+ children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.string), PropTypes.string),
7629
7629
  className: PropTypes.string,
7630
7630
  copyButtons: PropTypes.bool,
7631
7631
  lang: PropTypes.string,
@@ -7659,18 +7659,17 @@ var React = __webpack_require__(3634);
7659
7659
  var _require2 = __webpack_require__(3634),
7660
7660
  useState = _require2.useState;
7661
7661
  var traverseProps = function traverseProps(props, fn) {
7662
- if (props !== null && props !== void 0 && props.children) {
7663
- if (props.children.forEach) {
7662
+ if (!props) return;
7663
+ fn(props);
7664
+ if (props && 'children' in props) {
7665
+ if (Array.isArray(props.children)) {
7664
7666
  props.children.forEach(function (child) {
7665
- if (child.props) {
7666
- traverseProps(child.props, fn);
7667
- }
7667
+ return child.props && traverseProps(child.props, fn);
7668
7668
  });
7669
7669
  } else {
7670
- fn(props.children.props);
7670
+ traverseProps(props.children.props, fn);
7671
7671
  }
7672
7672
  }
7673
- fn(props);
7674
7673
  };
7675
7674
  var CodeTabs = function CodeTabs(props) {
7676
7675
  var children = props.children,
@@ -7725,7 +7724,7 @@ var CodeTabs = function CodeTabs(props) {
7725
7724
  }, children));
7726
7725
  };
7727
7726
  CodeTabs.propTypes = {
7728
- children: PropTypes.arrayOf(PropTypes.any).isRequired,
7727
+ children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.any), PropTypes.object),
7729
7728
  theme: PropTypes.string
7730
7729
  };
7731
7730
  function CreateCodeTabs(_ref3) {
@@ -7774,7 +7773,7 @@ var Div = function Div(_ref) {
7774
7773
  return /*#__PURE__*/React.createElement("div", props);
7775
7774
  };
7776
7775
  Div.propTypes = {
7777
- children: PropTypes.arrayOf(PropTypes.any),
7776
+ children: PropTypes.oneOf(PropTypes.arrayOf(PropTypes.any), PropTypes.object),
7778
7777
  className: PropTypes.string,
7779
7778
  components: PropTypes.object
7780
7779
  };
@@ -34380,7 +34379,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
34380
34379
  /* eslint-disable no-param-reassign */
34381
34380
 
34382
34381
  __webpack_require__(2787);
34383
- var MDXRuntime = (__webpack_require__(2114)["default"]);
34382
+ var Mdx = (__webpack_require__(2114)["default"]);
34384
34383
  var Variable = __webpack_require__(1882);
34385
34384
  var generateTOC = __webpack_require__(3263);
34386
34385
  var React = __webpack_require__(3634);
@@ -34600,7 +34599,7 @@ function react(content) {
34600
34599
  })), transformers, [remarkSlug, [remarkDisableTokenizers, opts.disableTokenizers]]);
34601
34600
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
34602
34601
  key: content
34603
- }, /*#__PURE__*/React.createElement(MDXRuntime, {
34602
+ }, /*#__PURE__*/React.createElement(Mdx, {
34604
34603
  components: reactComponents(opts, components),
34605
34604
  rehypePlugins: [sectionAnchorId],
34606
34605
  remarkPlugins: remarkPlugins
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "6.66.0-beta.5",
5
+ "version": "6.66.0-beta.6",
6
6
  "main": "dist/main.node.js",
7
7
  "browser": "dist/main.js",
8
8
  "files": [