{"name":"@mdx-js/react","version":"1.3.2","description":"React implementation for MDX","license":"MIT","keywords":["mdx","markdown","react","jsx","remark","mdxast"],"homepage":"https://mdxjs.com","repository":{"type":"git","url":"git+https://github.com/mdx-js/mdx.git"},"bugs":{"url":"https://github.com/mdx-js/mdx/issues"},"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com"},"contributors":[{"name":"John Otander","email":"johnotander@gmail.com","url":"http://johnotander.com"},{"name":"Tim Neutkens","email":"tim@zeit.co"},{"name":"Matija Marohnić","email":"matija.marohnic@gmail.com"},{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"main":"dist/index.js","module":"dist/index.es.js","devDependencies":{"@babel/core":"7.5.5","@babel/preset-env":"7.5.5","@babel/preset-react":"7.0.0","jest":"24.8.0","microbundle":"0.11.0","react":"16.9.0","react-dom":"16.9.0","rimraf":"2.6.3"},"peerDependencies":{"react":"^16.9.0"},"scripts":{"build":"microbundle --format es,cjs --external react --jsx React.createElement --no-sourcemap --no-compress","clean":"rimraf dist","prepublish":"npm run clean && npm run build","test":"jest"},"gitHead":"c9118da7f36a71b2fd0edd88bad332b33708c933","_id":"@mdx-js/react@1.3.2","_nodeVersion":"12.6.0","_npmVersion":"lerna/3.16.4/node@v12.6.0+x64 (darwin)","dist":{"integrity":"sha512-qSRooui9cI9/AR3M+rl3LobxU5SPDiFn/wiP4pqs5eSJEXePUuAfx/HCkVHAHimgmDRxXtCjDHhvhtQvhywBeA==","shasum":"d1d2f9c9cf88ad080354a86dc6b6cd64b3c0a4ee","tarball":"http://registry-npm.ywwl.com/@mdx-js/react/download/@mdx-js/react-1.3.2.tgz","fileCount":5,"unpackedSize":10250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYtnDCRA9TVsSAnZWagAAObUP/1f3jEGHfz3G0AzeELiu\n5dtC5SPJFxkzrJBUNgAWI239VPOpnv+oXhnAnhd8WwjdaCYEmi5AmpD7rwUP\nIwESVqf0LZqHx/U1P/eaNRePdOjl+M45RGnqktFgLc+/UzmIwcFUBmMO+zsz\nnfR5bad8EKLFHyExajCvKGJMOeERJ+KjqEovhOFDHk1UBApSi7TyJ4Adg58Q\n+n9XissnEeN6CA1ntHtMVqEWaRQ8NwxYZNw+g/QV5Ev9joyyeoNZRYQCJcuU\nFW7gPYMNoDlQAPo4GvsX9WKrKq4kWZYnFZK919AHeSJBqtPqoW7V+TiO2nNW\nu4Yo4Rr21aqQAaSHff8RoKafhiTLgRrp9nG8qmBMH4e1XjrkHCdjSXD7Iuam\nj+XRcZZi0J0gTPCkZLvxC0geJsPqDCuKXKvs00a1CjiNIm9pINLLD9hWyvgF\ns3+Yap7Po2s17oyMnNWmkpL5/KgUXWV87JiJbUBQWv5jYKc9qVcdu5tyqy7S\nrLjjqM+ewXE57byyBDlUlhCsCTu0gvJTUwKAgCSLyTLrimE42dchkS7n0XAQ\ndGqjjbwRCQRt4NaRqx1OeooRmYVxe933LVBBboKfY8+We5z1zsSzsItJGbTA\neiW8vGvSuQmPdMcRSzlJD6PuQKwQA0TX47krUNDqnPhB2hJSPj1nBTJu5w4Y\ngpGs\r\n=hEVZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOLmmGw09k+5HgPxAJfdc58RfPfcuMHK7ifxFUTmgdcQIhAMwjqzx8lYW/eR3LJY9z3npWGbeiKDfBFMsDJBmGvDgQ"}],"size":3326,"noattachment":false,"key":"/@mdx-js/react/-/@mdx-js/react-1.3.2.tgz"},"maintainers":[{"email":"johnotander@gmail.com","name":"johno"},{"email":"matija.marohnic@gmail.com","name":"silvenon"},{"email":"tim@timneutkens.nl","name":"timneutkens"},{"email":"tituswormer@gmail.com","name":"wooorm"}],"_npmUser":{"name":"johno","email":"johnotander@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react_1.3.2_1566759363264_0.29169746146386255"},"_hasShrinkwrap":false,"readme":"# `@mdx-js/react`\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\nReact context for MDX.\n\n<!-- more -->\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`MDXProvider(properties?)`](#mdxproviderproperties)\n  * [`useMDXComponents(components?)`](#usemdxcomponentscomponents)\n  * [`MergeComponents`](#mergecomponents)\n  * [`Props`](#props)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a *context* based components provider for combining React with\nMDX.\n\n## When should I use this?\n\nThis package is **not needed** for MDX to work with React.\nSee [¶ MDX provider in § Using MDX][use-provider] for when and how to use an MDX\nprovider.\n\nIf you use Next.js, **do not use this**.\nAdd an `mdx-components.tsx` (in `src/` or `/`) file instead.\nSee [Configuring MDX on `nextjs.org`][next-configuring-mdx] for more info.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install @mdx-js/react\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```tsx\nimport {MDXProvider} from 'https://esm.sh/@mdx-js/react@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {MDXProvider} from 'https://esm.sh/@mdx-js/react@3?bundle'\n</script>\n```\n\n## Use\n\n```tsx\nimport {MDXProvider} from '@mdx-js/react'\nimport Post from './post.mdx'\n// ^-- Assumes an integration is used to compile MDX to JS, such as\n// `@mdx-js/esbuild`, `@mdx-js/loader`, `@mdx-js/node-loader`, or\n// `@mdx-js/rollup`, and that it is configured with\n// `options.providerImportSource: '@mdx-js/react'`.\n\n/** @type {import('mdx/types.js').MDXComponents} */\nconst components = {\n  em(properties) {\n    return <i {...properties} />\n  }\n}\n\nconsole.log(\n  <MDXProvider components={components}>\n    <Post />\n  </MDXProvider>\n)\n```\n\n> 👉 **Note**: you don’t have to use `MDXProvider` and can pass components\n> directly:\n>\n> ```diff\n> -<MDXProvider components={components}>\n> -  <Post />\n> -</MDXProvider>\n> +<Post components={components} />\n> ```\n\nSee [¶ React in § Getting started][start-react] for how to get started with MDX\nand React.\nSee [¶ MDX provider in § Using MDX][use-provider] for how to use an MDX\nprovider.\n\n## API\n\nThis package exports the identifiers [`MDXProvider`][api-mdx-provider] and\n[`useMDXComponents`][api-use-mdx-components].\nThere is no default export.\n\n### `MDXProvider(properties?)`\n\nProvider for MDX context.\n\n###### Parameters\n\n* `properties` ([`Props`][api-props])\n  — configuration\n\n##### Returns\n\nElement (`JSX.Element`).\n\n### `useMDXComponents(components?)`\n\nGet current components from the MDX Context.\n\n###### Parameters\n\n* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components]\n  or [`MergeComponents`][api-merge-components], optional)\n  — additional components to use or a function that creates them\n\n###### Returns\n\nCurrent components ([`MDXComponents` from\n`mdx/types.js`][mdx-types-components]).\n\n### `MergeComponents`\n\nCustom merge function (TypeScript type).\n\n###### Parameters\n\n* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components])\n  — current components from the context\n\n###### Returns\n\nAdditional components ([`MDXComponents` from\n`mdx/types.js`][mdx-types-components]).\n\n### `Props`\n\nConfiguration for `MDXProvider` (TypeScript type).\n\n###### Fields\n\n* `children` ([`ReactNode` from `react`][react-node],\n  optional)\n  — children\n* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components]\n  or [`MergeComponents`][api-merge-components], optional)\n  — additional components to use or a function that creates them\n* `disableParentContext` (`boolean`, default: `false`)\n  — turn off outer component context\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`MergeComponents`][api-merge-components] and\n[`Props`][api-props].\n\nFor types to work, make sure the TypeScript `JSX` namespace is typed.\nThis is done by installing and using the types of your framework, as in\n[`@types/react`](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `@mdx-js/react@^3`,\ncompatible with Node.js 16.\n\n## Security\n\nSee [§ Security][security] on our website for information.\n\n## Contribute\n\nSee [§ Contribute][contribute] on our website for ways to get started.\nSee [§ Support][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][] © Compositor and [Vercel][]\n\n[build-badge]: https://github.com/mdx-js/mdx/workflows/main/badge.svg\n\n[build]: https://github.com/mdx-js/mdx/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/mdx-js/mdx/main.svg\n\n[coverage]: https://codecov.io/github/mdx-js/mdx\n\n[downloads-badge]: https://img.shields.io/npm/dm/@mdx-js/react.svg\n\n[downloads]: https://www.npmjs.com/package/@mdx-js/react\n\n[size-badge]: https://img.shields.io/bundlejs/size/@mdx-js/react\n\n[size]: https://bundlejs.com/?q=@mdx-js/react\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/mdx-js/mdx/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[contribute]: https://mdxjs.com/community/contribute/\n\n[support]: https://mdxjs.com/community/support/\n\n[coc]: https://github.com/mdx-js/.github/blob/main/code-of-conduct.md\n\n[mit]: https://github.com/mdx-js/mdx/blob/main/packages/react/license\n\n[vercel]: https://vercel.com\n\n[start-react]: https://mdxjs.com/getting-started/#react\n\n[use-provider]: https://mdxjs.com/docs/using-mdx/#mdx-provider\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[security]: https://mdxjs.com/getting-started/#security\n\n[typescript]: https://www.typescriptlang.org\n\n[mdx-types-components]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/HEAD/types/mdx/types.d.ts#L65\n\n[react-node]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/HEAD/types/react/index.d.ts#L244\n\n[next-configuring-mdx]: https://nextjs.org/docs/pages/building-your-application/configuring/mdx\n\n[api-mdx-provider]: #mdxproviderproperties\n\n[api-merge-components]: #mergecomponents\n\n[api-props]: #props\n\n[api-use-mdx-components]: #usemdxcomponentscomponents\n","publish_time":1566759363417,"_cnpm_publish_time":1566759363417,"dist-tags":{"ci":"2.0.0-ci.53","latest":"3.1.1","next":"2.0.0-rc.2"}}