1- import { MDXTag } from '@mdx-js/tag' ;
21import Foo from './foo' ;
32import Another from './another' ;
43
5- const SomeMDXComponent = ( {
6- components,
7- ...props
8- } ) => < MDXTag name = "wrapper" components = { components } > < MDXTag name = "h2" components = { components } > { `This is some MDX source` } </ MDXTag >
9- < SomeComponent />
10- < MDXTag name = "p" components = { components } > < MDXTag name = "del" components = { components } parentName = "p" > { `strikethrough` } </ MDXTag > </ MDXTag > </ MDXTag > ;
4+ /** @jsx mdx */
5+ import { mdx } from '@mdx-js/react' ;
6+
7+ const SomeMDXComponent = function ( ) {
8+ function _objectWithoutProperties ( source , excluded ) {
9+ if ( source == null ) return { } ;
10+
11+ var target = _objectWithoutPropertiesLoose ( source , excluded ) ;
12+
13+ var key , i ;
14+
15+ if ( Object . getOwnPropertySymbols ) {
16+ var sourceSymbolKeys = Object . getOwnPropertySymbols ( source ) ;
17+
18+ for ( i = 0 ; i < sourceSymbolKeys . length ; i ++ ) {
19+ key = sourceSymbolKeys [ i ] ;
20+ if ( excluded . indexOf ( key ) >= 0 ) continue ;
21+ if ( ! Object . prototype . propertyIsEnumerable . call ( source , key ) ) continue ;
22+ target [ key ] = source [ key ] ;
23+ }
24+ }
25+
26+ return target ;
27+ }
28+
29+ function _objectWithoutPropertiesLoose ( source , excluded ) {
30+ if ( source == null ) return { } ;
31+ var target = { } ;
32+ var sourceKeys = Object . keys ( source ) ;
33+ var key , i ;
34+
35+ for ( i = 0 ; i < sourceKeys . length ; i ++ ) {
36+ key = sourceKeys [ i ] ;
37+ if ( excluded . indexOf ( key ) >= 0 ) continue ;
38+ target [ key ] = source [ key ] ;
39+ }
40+
41+ return target ;
42+ }
43+ /* @jsx mdx */
44+
45+
46+ const makeShortcode = name => function MDXDefaultShortcode ( props ) {
47+ console . warn ( "Component " + name + " was not imported, exported, or provided by MDXProvider as global scope" ) ;
48+ return < div { ...props } /> ;
49+ } ;
50+
51+ const SomeComponent = makeShortcode ( "SomeComponent" ) ;
52+ const layoutProps = { } ;
53+ const MDXLayout = "wrapper" ;
54+
55+ function MDXContent ( _ref ) {
56+ let {
57+ components
58+ } = _ref ,
59+ props = _objectWithoutProperties ( _ref , [ "components" ] ) ;
60+
61+ return < MDXLayout { ...layoutProps } { ...props } components = { components } mdxType = "MDXLayout" >
62+ < h2 > { `This is some MDX source` } </ h2 >
63+ < SomeComponent mdxType = "SomeComponent" />
64+
65+ < p > < del parentName = "p" > { `strikethrough` } </ del > </ p >
66+ </ MDXLayout > ;
67+ }
68+
69+ MDXContent . isMDXComponent = true ;
70+ return MDXContent ;
71+ } ( ) ;
0 commit comments