@mdx-js/mdx
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -8,2 +8,3 @@ function toJSX(node, parentNode = {}) { | ||
const jsxNodes = [] | ||
let layout | ||
for (const childNode of node.children) { | ||
@@ -16,2 +17,7 @@ if (childNode.type === 'import') { | ||
if (childNode.type === 'export') { | ||
if(childNode.default) { | ||
layout = childNode.value.replace(/^export default /, '') | ||
continue | ||
} | ||
exportNodes.push(childNode) | ||
@@ -29,3 +35,3 @@ continue | ||
'\n' + | ||
`export default ({components}) => <MDXTag name="wrapper">${jsxNodes | ||
`export default ({components}) => <MDXTag name="wrapper" ${layout ? `Layout={${layout}}` : ''} components={components}>${jsxNodes | ||
.map(childNode => toJSX(childNode, node)) | ||
@@ -32,0 +38,0 @@ .join('')}</MDXTag>` |
{ | ||
"name": "@mdx-js/mdx", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"license": "MIT", | ||
@@ -23,3 +23,3 @@ "repository": "mdx-js/mdx", | ||
"dependencies": { | ||
"@mdx-js/mdxast": "^0.7.2", | ||
"@mdx-js/mdxast": "^0.10.0", | ||
"mdast-util-to-hast": "^3.0.0", | ||
@@ -26,0 +26,0 @@ "remark-parse": "^5.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6706
156
+ Added@mdx-js/mdxast@0.10.0(transitive)
- Removed@mdx-js/mdxast@0.7.2(transitive)
Updated@mdx-js/mdxast@^0.10.0