-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Prep for v1 release * v1.0.0-alpha.2 * Add test for using inline as a value on an object * Version bump * Add indented object example spec, update readme with breaking changes, added dedent library to format template strings * Publish 1.0.0-alpha.4 * v1.0.0
- Loading branch information
Showing
17 changed files
with
3,111 additions
and
1,864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"proseWrap": "always", | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": false, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,67 @@ | ||
const SomeMDXComponent = ({ | ||
components, | ||
...props | ||
}) => <MDXTag name="wrapper" components={components}><MDXTag name="h2" components={components}>{`This is some MDX source`}</MDXTag> | ||
<SomeComponent /> | ||
<MDXTag name="p" components={components}><MDXTag name="del" components={components} parentName="p">{`strikethrough`}</MDXTag></MDXTag></MDXTag>; | ||
/** @jsx mdx */ | ||
import { mdx } from '@mdx-js/react'; | ||
|
||
const SomeMDXComponent = function () { | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
|
||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
|
||
var key, i; | ||
|
||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
|
||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
|
||
return target; | ||
} | ||
|
||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
|
||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
|
||
return target; | ||
} | ||
/* @jsx mdx */ | ||
|
||
|
||
const makeShortcode = name => function MDXDefaultShortcode(props) { | ||
console.warn("Component " + name + " was not imported, exported, or provided by MDXProvider as global scope"); | ||
return <div {...props} />; | ||
}; | ||
|
||
const SomeComponent = makeShortcode("SomeComponent"); | ||
const layoutProps = {}; | ||
const MDXLayout = "wrapper"; | ||
|
||
function MDXContent(_ref) { | ||
let { | ||
components | ||
} = _ref, | ||
props = _objectWithoutProperties(_ref, ["components"]); | ||
|
||
return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout"> | ||
<h2>{`This is some MDX source`}</h2> | ||
<SomeComponent mdxType="SomeComponent" /> | ||
<p><del parentName="p">{`strikethrough`}</del></p> | ||
</MDXLayout>; | ||
} | ||
|
||
MDXContent.isMDXComponent = true; | ||
return MDXContent; | ||
}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** @jsx mdx */ | ||
import { mdx } from '@mdx-js/react' | ||
import { inline } from '../../inline-mdx.macro' | ||
|
||
const key = 'property' | ||
|
||
const object = { | ||
[key]: inline` | ||
## This is some MDX source | ||
<SomeComponent /> | ||
~~strikethrough~~ | ||
`, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** @jsx mdx */ | ||
import { mdx } from '@mdx-js/react'; | ||
const key = 'property'; | ||
const object = { | ||
[key]: function () { | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
|
||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
|
||
var key, i; | ||
|
||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
|
||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
|
||
return target; | ||
} | ||
|
||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
|
||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
|
||
return target; | ||
} | ||
/* @jsx mdx */ | ||
|
||
|
||
const makeShortcode = name => function MDXDefaultShortcode(props) { | ||
console.warn("Component " + name + " was not imported, exported, or provided by MDXProvider as global scope"); | ||
return <div {...props} />; | ||
}; | ||
|
||
const SomeComponent = makeShortcode("SomeComponent"); | ||
const layoutProps = {}; | ||
const MDXLayout = "wrapper"; | ||
|
||
function MDXContent(_ref) { | ||
let { | ||
components | ||
} = _ref, | ||
props = _objectWithoutProperties(_ref, ["components"]); | ||
|
||
return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout"> | ||
<h2>{`This is some MDX source`}</h2> | ||
<SomeComponent mdxType="SomeComponent" /> | ||
<p><del parentName="p">{`strikethrough`}</del></p> | ||
</MDXLayout>; | ||
} | ||
|
||
MDXContent.isMDXComponent = true; | ||
return MDXContent; | ||
}() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,71 @@ | ||
import { MDXTag } from '@mdx-js/tag'; | ||
import Foo from './foo'; | ||
import Another from './another'; | ||
|
||
const SomeMDXComponent = ({ | ||
components, | ||
...props | ||
}) => <MDXTag name="wrapper" components={components}><MDXTag name="h2" components={components}>{`This is some MDX source`}</MDXTag> | ||
<SomeComponent /> | ||
<MDXTag name="p" components={components}><MDXTag name="del" components={components} parentName="p">{`strikethrough`}</MDXTag></MDXTag></MDXTag>; | ||
/** @jsx mdx */ | ||
import { mdx } from '@mdx-js/react'; | ||
|
||
const SomeMDXComponent = function () { | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
|
||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
|
||
var key, i; | ||
|
||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
|
||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
|
||
return target; | ||
} | ||
|
||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
|
||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
|
||
return target; | ||
} | ||
/* @jsx mdx */ | ||
|
||
|
||
const makeShortcode = name => function MDXDefaultShortcode(props) { | ||
console.warn("Component " + name + " was not imported, exported, or provided by MDXProvider as global scope"); | ||
return <div {...props} />; | ||
}; | ||
|
||
const SomeComponent = makeShortcode("SomeComponent"); | ||
const layoutProps = {}; | ||
const MDXLayout = "wrapper"; | ||
|
||
function MDXContent(_ref) { | ||
let { | ||
components | ||
} = _ref, | ||
props = _objectWithoutProperties(_ref, ["components"]); | ||
|
||
return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout"> | ||
<h2>{`This is some MDX source`}</h2> | ||
<SomeComponent mdxType="SomeComponent" /> | ||
|
||
<p><del parentName="p">{`strikethrough`}</del></p> | ||
</MDXLayout>; | ||
} | ||
|
||
MDXContent.isMDXComponent = true; | ||
return MDXContent; | ||
}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** @jsx mdx */ | ||
import { mdx } from '@mdx-js/react' | ||
import { inline } from '../../inline-mdx.macro' | ||
|
||
const object = { | ||
property: inline` | ||
## This is some MDX source | ||
<SomeComponent /> | ||
~~strikethrough~~ | ||
`, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** @jsx mdx */ | ||
import { mdx } from '@mdx-js/react'; | ||
const object = { | ||
property: function () { | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
|
||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
|
||
var key, i; | ||
|
||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | ||
|
||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | ||
target[key] = source[key]; | ||
} | ||
} | ||
|
||
return target; | ||
} | ||
|
||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
|
||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
|
||
return target; | ||
} | ||
/* @jsx mdx */ | ||
|
||
|
||
const makeShortcode = name => function MDXDefaultShortcode(props) { | ||
console.warn("Component " + name + " was not imported, exported, or provided by MDXProvider as global scope"); | ||
return <div {...props} />; | ||
}; | ||
|
||
const SomeComponent = makeShortcode("SomeComponent"); | ||
const layoutProps = {}; | ||
const MDXLayout = "wrapper"; | ||
|
||
function MDXContent(_ref) { | ||
let { | ||
components | ||
} = _ref, | ||
props = _objectWithoutProperties(_ref, ["components"]); | ||
|
||
return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout"> | ||
<h2>{`This is some MDX source`}</h2> | ||
<SomeComponent mdxType="SomeComponent" /> | ||
<p><del parentName="p">{`strikethrough`}</del></p> | ||
</MDXLayout>; | ||
} | ||
|
||
MDXContent.isMDXComponent = true; | ||
return MDXContent; | ||
}() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** @jsx mdx */ | ||
import { mdx } from '@mdx-js/react' | ||
import { inline } from '../../inline-mdx.macro' | ||
|
||
const object = { | ||
property: { | ||
nested: { | ||
foo: inline` | ||
## This is some MDX source | ||
<SomeComponent /> | ||
import Foo from './foo'; | ||
import Another from './another'; | ||
~~strikethrough~~ | ||
`, | ||
}, | ||
}, | ||
} |
Oops, something went wrong.