repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 4.24 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar MULTIPLE_NAVIGATOR_ERROR = `Another navigator is already registered for this container. You likely have multiple navigators under a single \"NavigationContainer\" or \"Screen\". Make sure each navigator is under a separate \"Screen\" container. See https://reactnavigation.org/docs/nesting-navigators for a guide on nesting.`;\nexport var SingleNavigatorContext = React.createContext(undefined);\nexport function EnsureSingleNavigator(_ref) {\n var children = _ref.children;\n var navigatorKeyRef = React.useRef(undefined);\n var value = React.useMemo(function () {\n return {\n register: function register(key) {\n var currentKey = navigatorKeyRef.current;\n if (currentKey !== undefined && key !== currentKey) {\n throw new Error(MULTIPLE_NAVIGATOR_ERROR);\n }\n navigatorKeyRef.current = key;\n },\n unregister: function unregister(key) {\n var currentKey = navigatorKeyRef.current;\n if (key !== currentKey) {\n return;\n }\n navigatorKeyRef.current = undefined;\n }\n };\n }, []);\n return _jsx(SingleNavigatorContext.Provider, {\n value: value,\n children: children\n });\n}","map":{"version":3,"names":["React","jsx","_jsx","MULTIPLE_NAVIGATOR_ERROR","SingleNavigatorContext","createContext","undefined","EnsureSingleNavigator","_ref","children","navigatorKeyRef","useRef","value","useMemo","register","key","currentKey","current","Error","unregister","Provider"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/EnsureSingleNavigator.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype Props = {\n children: React.ReactNode;\n};\n\nconst MULTIPLE_NAVIGATOR_ERROR = `Another navigator is already registered for this container. You likely have multiple navigators under a single \"NavigationContainer\" or \"Screen\". Make sure each navigator is under a separate \"Screen\" container. See https://reactnavigation.org/docs/nesting-navigators for a guide on nesting.`;\n\nexport const SingleNavigatorContext = React.createContext<\n | {\n register(key: string): void;\n unregister(key: string): void;\n }\n | undefined\n>(undefined);\n\n/**\n * Component which ensures that there's only one navigator nested under it.\n */\nexport function EnsureSingleNavigator({ children }: Props) {\n const navigatorKeyRef = React.useRef<string | undefined>(undefined);\n\n const value = React.useMemo(\n () => ({\n register(key: string) {\n const currentKey = navigatorKeyRef.current;\n\n if (currentKey !== undefined && key !== currentKey) {\n throw new Error(MULTIPLE_NAVIGATOR_ERROR);\n }\n\n navigatorKeyRef.current = key;\n },\n unregister(key: string) {\n const currentKey = navigatorKeyRef.current;\n\n if (key !== currentKey) {\n return;\n }\n\n navigatorKeyRef.current = undefined;\n },\n }),\n []\n );\n\n return (\n <SingleNavigatorContext.Provider value={value}>\n {children}\n </SingleNavigatorContext.Provider>\n );\n}\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAM/B,IAAMC,wBAAwB,GAAG,oSAAoS;AAErU,OAAO,IAAMC,sBAAsB,GAAGJ,KAAK,CAACK,aAAa,CAMvDC,SAAS,CAAC;AAKZ,OAAO,SAASC,qBAAqBA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,QAAA,GAAAD,IAAA,CAAAC,QAAA;EACtC,IAAMC,eAAe,GAAGV,KAAK,CAACW,MAAM,CAAqBL,SAAS,CAAC;EAEnE,IAAMM,KAAK,GAAGZ,KAAK,CAACa,OAAO,CACzB;IAAA,OAAO;MACLC,QAAQ,WAARA,QAAQA,CAACC,GAAW,EAAE;QACpB,IAAMC,UAAU,GAAGN,eAAe,CAACO,OAAO;QAE1C,IAAID,UAAU,KAAKV,SAAS,IAAIS,GAAG,KAAKC,UAAU,EAAE;UAClD,MAAM,IAAIE,KAAK,CAACf,wBAAwB,CAAC;QAC3C;QAEAO,eAAe,CAACO,OAAO,GAAGF,GAAG;MAC/B,CAAC;MACDI,UAAU,WAAVA,UAAUA,CAACJ,GAAW,EAAE;QACtB,IAAMC,UAAU,GAAGN,eAAe,CAACO,OAAO;QAE1C,IAAIF,GAAG,KAAKC,UAAU,EAAE;UACtB;QACF;QAEAN,eAAe,CAACO,OAAO,GAAGX,SAAS;MACrC;IACF,CAAC;EAAA,CAAC,EACF,EACF,CAAC;EAED,OACEJ,IAAA,CAACE,sBAAsB,CAACgB,QAAQ;IAACR,KAAK,EAAEA,KAAM;IAAAH,QAAA,EAC3CA;EAAQ,CACsB,CAAC;AAEtC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}