{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/components/registry-provider/context.ts"],"sourcesContent":["import { createContext } from '@wordpress/element';\nimport defaultRegistry from '../../default-registry';\n\nexport const Context = createContext( defaultRegistry );\nContext.displayName = 'RegistryProviderContext';\n\nconst { Consumer, Provider } = Context;\n\n/**\n * A custom React context consumer exposing the provided `registry` to\n * children components. Used along with the RegistryProvider.\n *\n * You can read more about the React context API here:\n * https://react.dev/learn/passing-data-deeply-with-context#step-3-provide-the-context\n *\n * @example\n * ```js\n * import {\n *   RegistryProvider,\n *   RegistryConsumer,\n *   createRegistry\n * } from '@wordpress/data';\n *\n * const registry = createRegistry( {} );\n *\n * const App = ( { props } ) => {\n *   return <RegistryProvider value={ registry }>\n *     <div>Hello There</div>\n *     <RegistryConsumer>\n *       { ( registry ) => (\n *         <ComponentUsingRegistry\n *         \t\t{ ...props }\n *         \t  registry={ registry }\n *       ) }\n *     </RegistryConsumer>\n *   </RegistryProvider>\n * }\n * ```\n */\nexport const RegistryConsumer = Consumer;\n\n/**\n * A custom Context provider for exposing the provided `registry` to children\n * components via a consumer.\n *\n * See <a href=\"#registryconsumer\">RegistryConsumer</a> documentation for\n * example.\n */\nexport default Provider;\n"],"mappings":";;;AAGA,MAAa,UAAU,cAAe,eAAgB;AACtD,QAAQ,cAAc;AAEtB,MAAM,EAAE,UAAU,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiC/B,MAAa,mBAAmB"}